diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AccountsOperationsExtensions.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AccountsOperationsExtensions.cs
deleted file mode 100644
index 49b38f8198e9..000000000000
--- a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AccountsOperationsExtensions.cs
+++ /dev/null
@@ -1,258 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.Automanage
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// Extension methods for AccountsOperations.
- ///
- public static partial class AccountsOperationsExtensions
- {
- ///
- /// Creates an Automanage Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Name of the Automanage account.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// Parameters supplied to create or update Automanage account.
- ///
- public static Account CreateOrUpdate(this IAccountsOperations operations, string accountName, string resourceGroupName, Account parameters)
- {
- return operations.CreateOrUpdateAsync(accountName, resourceGroupName, parameters).GetAwaiter().GetResult();
- }
-
- ///
- /// Creates an Automanage Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Name of the Automanage account.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// Parameters supplied to create or update Automanage account.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task CreateOrUpdateAsync(this IAccountsOperations operations, string accountName, string resourceGroupName, Account parameters, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(accountName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Get information about a Automanage account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The Automanage account name.
- ///
- ///
- /// The resource group name.
- ///
- public static Account Get(this IAccountsOperations operations, string accountName, string resourceGroupName)
- {
- return operations.GetAsync(accountName, resourceGroupName).GetAwaiter().GetResult();
- }
-
- ///
- /// Get information about a Automanage account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The Automanage account name.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetAsync(this IAccountsOperations operations, string accountName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.GetWithHttpMessagesAsync(accountName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Delete a Automanage account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// Name of the Automanage account
- ///
- public static void Delete(this IAccountsOperations operations, string resourceGroupName, string accountName)
- {
- operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult();
- }
-
- ///
- /// Delete a Automanage account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// Name of the Automanage account
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task DeleteAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken))
- {
- (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose();
- }
-
- ///
- /// Updates an Automanage Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Name of the Automanage account.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// Parameters supplied to update Automanage account.
- ///
- public static Account Update(this IAccountsOperations operations, string accountName, string resourceGroupName, Account parameters)
- {
- return operations.UpdateAsync(accountName, resourceGroupName, parameters).GetAwaiter().GetResult();
- }
-
- ///
- /// Updates an Automanage Account
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Name of the Automanage account.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// Parameters supplied to update Automanage account.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task UpdateAsync(this IAccountsOperations operations, string accountName, string resourceGroupName, Account parameters, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.UpdateWithHttpMessagesAsync(accountName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Retrieve a list of Automanage accounts within a given resource group
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The resource group name.
- ///
- public static IEnumerable ListByResourceGroup(this IAccountsOperations operations, string resourceGroupName)
- {
- return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult();
- }
-
- ///
- /// Retrieve a list of Automanage accounts within a given resource group
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListByResourceGroupAsync(this IAccountsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Retrieve a list of Automanage accounts within a subscription
- ///
- ///
- /// The operations group for this extension method.
- ///
- public static IEnumerable ListBySubscription(this IAccountsOperations operations)
- {
- return operations.ListBySubscriptionAsync().GetAwaiter().GetResult();
- }
-
- ///
- /// Retrieve a list of Automanage accounts within a subscription
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListBySubscriptionAsync(this IAccountsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- }
-}
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AutomanageClient.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AutomanageClient.cs
index f817a238c76a..fc0630fa3710 100644
--- a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AutomanageClient.cs
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AutomanageClient.cs
@@ -47,13 +47,12 @@ public partial class AutomanageClient : ServiceClient, IAutoma
public ServiceClientCredentials Credentials { get; private set; }
///
- /// Client Api Version.
+ /// The API version to use for this operation.
///
public string ApiVersion { get; private set; }
///
- /// Subscription ID which uniquely identify Microsoft Azure subscription. The
- /// subscription ID forms part of the URI for every service call.
+ /// The ID of the target subscription.
///
public string SubscriptionId { get; set; }
@@ -76,25 +75,45 @@ public partial class AutomanageClient : ServiceClient, IAutoma
public bool? GenerateClientRequestId { get; set; }
///
- /// Gets the IAccountsOperations.
+ /// Gets the IBestPracticesOperations.
///
- public virtual IAccountsOperations Accounts { get; private set; }
+ public virtual IBestPracticesOperations BestPractices { get; private set; }
///
- /// Gets the IConfigurationProfileAssignmentsOperations.
+ /// Gets the IBestPracticesVersionsOperations.
///
- public virtual IConfigurationProfileAssignmentsOperations ConfigurationProfileAssignments { get; private set; }
+ public virtual IBestPracticesVersionsOperations BestPracticesVersions { get; private set; }
+
+ ///
+ /// Gets the IConfigurationProfilesOperations.
+ ///
+ public virtual IConfigurationProfilesOperations ConfigurationProfiles { get; private set; }
+
+ ///
+ /// Gets the IConfigurationProfilesVersionsOperations.
+ ///
+ public virtual IConfigurationProfilesVersionsOperations ConfigurationProfilesVersions { get; private set; }
///
- /// Gets the IConfigurationProfilePreferencesOperations.
+ /// Gets the IConfigurationProfileAssignmentsOperations.
///
- public virtual IConfigurationProfilePreferencesOperations ConfigurationProfilePreferences { get; private set; }
+ public virtual IConfigurationProfileAssignmentsOperations ConfigurationProfileAssignments { get; private set; }
///
/// Gets the IOperations.
///
public virtual IOperations Operations { get; private set; }
+ ///
+ /// Gets the IReportsOperations.
+ ///
+ public virtual IReportsOperations Reports { get; private set; }
+
+ ///
+ /// Gets the IServicePrincipalsOperations.
+ ///
+ public virtual IServicePrincipalsOperations ServicePrincipals { get; private set; }
+
///
/// Initializes a new instance of the AutomanageClient class.
///
@@ -336,12 +355,16 @@ public AutomanageClient(System.Uri baseUri, ServiceClientCredentials credentials
///
private void Initialize()
{
- Accounts = new AccountsOperations(this);
+ BestPractices = new BestPracticesOperations(this);
+ BestPracticesVersions = new BestPracticesVersionsOperations(this);
+ ConfigurationProfiles = new ConfigurationProfilesOperations(this);
+ ConfigurationProfilesVersions = new ConfigurationProfilesVersionsOperations(this);
ConfigurationProfileAssignments = new ConfigurationProfileAssignmentsOperations(this);
- ConfigurationProfilePreferences = new ConfigurationProfilePreferencesOperations(this);
Operations = new Operations(this);
+ Reports = new ReportsOperations(this);
+ ServicePrincipals = new ServicePrincipalsOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2020-06-30-preview";
+ ApiVersion = "2021-04-30-preview";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesOperations.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesOperations.cs
new file mode 100644
index 000000000000..cb49031cd3bc
--- /dev/null
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesOperations.cs
@@ -0,0 +1,413 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Automanage
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// BestPracticesOperations operations.
+ ///
+ internal partial class BestPracticesOperations : IServiceOperations, IBestPracticesOperations
+ {
+ ///
+ /// Initializes a new instance of the BestPracticesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal BestPracticesOperations(AutomanageClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the AutomanageClient
+ ///
+ public AutomanageClient Client { get; private set; }
+
+ ///
+ /// Get information about a Automanage best practice
+ ///
+ ///
+ /// The Automanage best practice name.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string bestPracticeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (bestPracticeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "bestPracticeName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("bestPracticeName", bestPracticeName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Automanage/bestPractices/{bestPracticeName}").ToString();
+ _url = _url.Replace("{bestPracticeName}", System.Uri.EscapeDataString(bestPracticeName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Retrieve a list of Automanage best practices
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByTenantWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByTenant", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Automanage/bestPractices").ToString();
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesOperationsExtensions.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesOperationsExtensions.cs
new file mode 100644
index 000000000000..5cc67d75f4f4
--- /dev/null
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesOperationsExtensions.cs
@@ -0,0 +1,89 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Automanage
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for BestPracticesOperations.
+ ///
+ public static partial class BestPracticesOperationsExtensions
+ {
+ ///
+ /// Get information about a Automanage best practice
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The Automanage best practice name.
+ ///
+ public static BestPractice Get(this IBestPracticesOperations operations, string bestPracticeName)
+ {
+ return operations.GetAsync(bestPracticeName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get information about a Automanage best practice
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The Automanage best practice name.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IBestPracticesOperations operations, string bestPracticeName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(bestPracticeName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Retrieve a list of Automanage best practices
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static IEnumerable ListByTenant(this IBestPracticesOperations operations)
+ {
+ return operations.ListByTenantAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Retrieve a list of Automanage best practices
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByTenantAsync(this IBestPracticesOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByTenantWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesVersionsOperations.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesVersionsOperations.cs
new file mode 100644
index 000000000000..3a555cbe22e4
--- /dev/null
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesVersionsOperations.cs
@@ -0,0 +1,431 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Automanage
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// BestPracticesVersionsOperations operations.
+ ///
+ internal partial class BestPracticesVersionsOperations : IServiceOperations, IBestPracticesVersionsOperations
+ {
+ ///
+ /// Initializes a new instance of the BestPracticesVersionsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal BestPracticesVersionsOperations(AutomanageClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the AutomanageClient
+ ///
+ public AutomanageClient Client { get; private set; }
+
+ ///
+ /// Get information about a Automanage best practice version
+ ///
+ ///
+ /// The Automanage best practice name.
+ ///
+ ///
+ /// The Automanage best practice version name.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string bestPracticeName, string versionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (bestPracticeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "bestPracticeName");
+ }
+ if (versionName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "versionName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("bestPracticeName", bestPracticeName);
+ tracingParameters.Add("versionName", versionName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Automanage/bestPractices/{bestPracticeName}/versions/{versionName}").ToString();
+ _url = _url.Replace("{bestPracticeName}", System.Uri.EscapeDataString(bestPracticeName));
+ _url = _url.Replace("{versionName}", System.Uri.EscapeDataString(versionName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Retrieve a list of Automanage best practices versions
+ ///
+ ///
+ /// The Automanage best practice name.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByTenantWithHttpMessagesAsync(string bestPracticeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (bestPracticeName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "bestPracticeName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("bestPracticeName", bestPracticeName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByTenant", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Automanage/bestPractices/{bestPracticeName}/versions").ToString();
+ _url = _url.Replace("{bestPracticeName}", System.Uri.EscapeDataString(bestPracticeName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesVersionsOperationsExtensions.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesVersionsOperationsExtensions.cs
new file mode 100644
index 000000000000..296657b24550
--- /dev/null
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/BestPracticesVersionsOperationsExtensions.cs
@@ -0,0 +1,101 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Automanage
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for BestPracticesVersionsOperations.
+ ///
+ public static partial class BestPracticesVersionsOperationsExtensions
+ {
+ ///
+ /// Get information about a Automanage best practice version
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The Automanage best practice name.
+ ///
+ ///
+ /// The Automanage best practice version name.
+ ///
+ public static BestPractice Get(this IBestPracticesVersionsOperations operations, string bestPracticeName, string versionName)
+ {
+ return operations.GetAsync(bestPracticeName, versionName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get information about a Automanage best practice version
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The Automanage best practice name.
+ ///
+ ///
+ /// The Automanage best practice version name.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IBestPracticesVersionsOperations operations, string bestPracticeName, string versionName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(bestPracticeName, versionName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Retrieve a list of Automanage best practices versions
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The Automanage best practice name.
+ ///
+ public static IEnumerable ListByTenant(this IBestPracticesVersionsOperations operations, string bestPracticeName)
+ {
+ return operations.ListByTenantAsync(bestPracticeName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Retrieve a list of Automanage best practices versions
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The Automanage best practice name.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByTenantAsync(this IBestPracticesVersionsOperations operations, string bestPracticeName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByTenantWithHttpMessagesAsync(bestPracticeName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfileAssignmentsOperations.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfileAssignmentsOperations.cs
index 841ad0a27cf1..e9191f3f3c3a 100644
--- a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfileAssignmentsOperations.cs
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfileAssignmentsOperations.cs
@@ -61,32 +61,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
/// assignment.
///
///
- /// The resource group name.
- ///
- ///
- /// The name of the virtual machine.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string configurationProfileAssignmentName, ConfigurationProfileAssignment parameters, string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- // Send Request
- AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(configurationProfileAssignmentName, parameters, resourceGroupName, vmName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get information about a configuration profile assignment
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// The configuration profile assignment name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the virtual machine.
@@ -112,26 +87,41 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string configurationProfileAssignmentName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string configurationProfileAssignmentName, ConfigurationProfileAssignment parameters, string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (resourceGroupName == null)
+ if (configurationProfileAssignmentName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileAssignmentName");
}
- if (resourceGroupName != null)
+ if (parameters == null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
- if (configurationProfileAssignmentName == null)
+ if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileAssignmentName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (Client.SubscriptionId == null)
+ if (resourceGroupName != null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
}
if (vmName == null)
{
@@ -141,6 +131,13 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -148,18 +145,19 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("configurationProfileAssignmentName", configurationProfileAssignmentName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("vmName", vmName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}").ToString();
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{configurationProfileAssignmentName}", System.Uri.EscapeDataString(configurationProfileAssignmentName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName));
List _queryParameters = new List();
if (Client.ApiVersion != null)
@@ -173,7 +171,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -204,6 +202,12 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
// Serialize Request
string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -224,7 +228,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -279,6 +283,24 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -287,13 +309,13 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
}
///
- /// Delete a configuration profile assignment
+ /// Get information about a configuration profile assignment
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
- /// Name of the configuration profile assignment
+ /// The configuration profile assignment name.
///
///
/// The name of the virtual machine.
@@ -307,6 +329,9 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -316,7 +341,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string configurationProfileAssignmentName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string configurationProfileAssignmentName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -324,9 +349,13 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (configurationProfileAssignmentName == null)
@@ -337,6 +366,13 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (vmName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "vmName");
@@ -345,6 +381,13 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -356,7 +399,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
tracingParameters.Add("configurationProfileAssignmentName", configurationProfileAssignmentName);
tracingParameters.Add("vmName", vmName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -377,7 +420,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -428,7 +471,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 204)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -458,13 +501,31 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -473,10 +534,16 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
}
///
- /// Get list of configuration profile assignments
+ /// Delete a configuration profile assignment
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// Name of the configuration profile assignment
+ ///
+ ///
+ /// The name of the virtual machine.
///
///
/// Headers that will be added to request.
@@ -487,9 +554,6 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
///
/// Thrown when the operation returned an invalid status code
///
- ///
- /// Thrown when unable to deserialize the response
- ///
///
/// Thrown when a required parameter is null
///
@@ -499,7 +563,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string configurationProfileAssignmentName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -507,19 +571,45 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
+ if (configurationProfileAssignmentName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileAssignmentName");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (vmName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "vmName");
+ }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -528,14 +618,18 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("configurationProfileAssignmentName", configurationProfileAssignmentName);
+ tracingParameters.Add("vmName", vmName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfileAssignments").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{configurationProfileAssignmentName}", System.Uri.EscapeDataString(configurationProfileAssignmentName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName));
List _queryParameters = new List();
if (Client.ApiVersion != null)
{
@@ -548,7 +642,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -599,7 +693,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -629,31 +723,13 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
- // Deserialize Response
- if ((int)_statusCode == 200)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -662,8 +738,11 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
}
///
- /// Get list of configuration profile assignments under a given subscription
+ /// Get list of configuration profile assignments
///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
///
/// Headers that will be added to request.
///
@@ -685,16 +764,45 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -702,12 +810,14 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Automanage/configurationProfileAssignments").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfileAssignments").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (Client.ApiVersion != null)
@@ -835,21 +945,8 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
}
///
- /// Creates an association between a VM and Automanage configuration profile
+ /// Get list of configuration profile assignments under a given subscription
///
- ///
- /// Name of the configuration profile assignment. Only default is supported.
- ///
- ///
- /// Parameters supplied to the create or update configuration profile
- /// assignment.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// The name of the virtual machine.
- ///
///
/// Headers that will be added to request.
///
@@ -871,39 +968,30 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string configurationProfileAssignmentName, ConfigurationProfileAssignment parameters, string resourceGroupName, string vmName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (configurationProfileAssignmentName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileAssignmentName");
- }
- if (parameters == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
- }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (resourceGroupName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
- }
- if (resourceGroupName != null)
+ if (Client.SubscriptionId != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (Client.SubscriptionId.Length < 1)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
- if (vmName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "vmName");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -911,20 +999,13 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("configurationProfileAssignmentName", configurationProfileAssignmentName);
- tracingParameters.Add("parameters", parameters);
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("vmName", vmName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.Automanage/configurationProfileAssignments/{configurationProfileAssignmentName}").ToString();
- _url = _url.Replace("{configurationProfileAssignmentName}", System.Uri.EscapeDataString(configurationProfileAssignmentName));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Automanage/configurationProfileAssignments").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{vmName}", System.Uri.EscapeDataString(vmName));
List _queryParameters = new List();
if (Client.ApiVersion != null)
{
@@ -937,7 +1018,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -968,12 +1049,6 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
// Serialize Request
string _requestContent = null;
- if(parameters != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -994,7 +1069,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1024,7 +1099,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1037,25 +1112,7 @@ internal ConfigurationProfileAssignmentsOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
- // Deserialize Response
- if ((int)_statusCode == 201)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfileAssignmentsOperationsExtensions.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfileAssignmentsOperationsExtensions.cs
index bd37c422f1f1..06152e556409 100644
--- a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfileAssignmentsOperationsExtensions.cs
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfileAssignmentsOperationsExtensions.cs
@@ -37,7 +37,7 @@ public static partial class ConfigurationProfileAssignmentsOperationsExtensions
/// assignment.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the virtual machine.
@@ -61,7 +61,7 @@ public static ConfigurationProfileAssignment CreateOrUpdate(this IConfigurationP
/// assignment.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the virtual machine.
@@ -84,7 +84,7 @@ public static ConfigurationProfileAssignment CreateOrUpdate(this IConfigurationP
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The configuration profile assignment name.
@@ -104,7 +104,7 @@ public static ConfigurationProfileAssignment Get(this IConfigurationProfileAssig
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The configuration profile assignment name.
@@ -130,7 +130,7 @@ public static ConfigurationProfileAssignment Get(this IConfigurationProfileAssig
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// Name of the configuration profile assignment
@@ -150,7 +150,7 @@ public static void Delete(this IConfigurationProfileAssignmentsOperations operat
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// Name of the configuration profile assignment
@@ -173,7 +173,7 @@ public static void Delete(this IConfigurationProfileAssignmentsOperations operat
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
public static IEnumerable List(this IConfigurationProfileAssignmentsOperations operations, string resourceGroupName)
{
@@ -187,7 +187,7 @@ public static IEnumerable List(this IConfigurati
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The cancellation token.
@@ -228,59 +228,5 @@ public static IEnumerable ListBySubscription(thi
}
}
- ///
- /// Creates an association between a VM and Automanage configuration profile
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Name of the configuration profile assignment. Only default is supported.
- ///
- ///
- /// Parameters supplied to the create or update configuration profile
- /// assignment.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// The name of the virtual machine.
- ///
- public static ConfigurationProfileAssignment BeginCreateOrUpdate(this IConfigurationProfileAssignmentsOperations operations, string configurationProfileAssignmentName, ConfigurationProfileAssignment parameters, string resourceGroupName, string vmName)
- {
- return operations.BeginCreateOrUpdateAsync(configurationProfileAssignmentName, parameters, resourceGroupName, vmName).GetAwaiter().GetResult();
- }
-
- ///
- /// Creates an association between a VM and Automanage configuration profile
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Name of the configuration profile assignment. Only default is supported.
- ///
- ///
- /// Parameters supplied to the create or update configuration profile
- /// assignment.
- ///
- ///
- /// The resource group name.
- ///
- ///
- /// The name of the virtual machine.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task BeginCreateOrUpdateAsync(this IConfigurationProfileAssignmentsOperations operations, string configurationProfileAssignmentName, ConfigurationProfileAssignment parameters, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(configurationProfileAssignmentName, parameters, resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
}
}
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilePreferencesOperations.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilesOperations.cs
similarity index 84%
rename from sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilePreferencesOperations.cs
rename to sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilesOperations.cs
index 98a6e17bb363..6a5821cd05bb 100644
--- a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilePreferencesOperations.cs
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilesOperations.cs
@@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Automanage
using System.Threading.Tasks;
///
- /// ConfigurationProfilePreferencesOperations operations.
+ /// ConfigurationProfilesOperations operations.
///
- internal partial class ConfigurationProfilePreferencesOperations : IServiceOperations, IConfigurationProfilePreferencesOperations
+ internal partial class ConfigurationProfilesOperations : IServiceOperations, IConfigurationProfilesOperations
{
///
- /// Initializes a new instance of the ConfigurationProfilePreferencesOperations class.
+ /// Initializes a new instance of the ConfigurationProfilesOperations class.
///
///
/// Reference to the service client.
@@ -36,7 +36,7 @@ internal partial class ConfigurationProfilePreferencesOperations : IServiceOpera
///
/// Thrown when a required parameter is null
///
- internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
+ internal ConfigurationProfilesOperations(AutomanageClient client)
{
if (client == null)
{
@@ -51,16 +51,16 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
public AutomanageClient Client { get; private set; }
///
- /// Creates a configuration profile preference
+ /// Creates a configuration profile
///
- ///
- /// Name of the configuration profile preference.
+ ///
+ /// Name of the configuration profile.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
- /// Parameters supplied to create or update configuration profile preference.
+ /// Parameters supplied to create or update configuration profile.
///
///
/// Headers that will be added to request.
@@ -83,35 +83,57 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string configurationProfilePreferenceName, string resourceGroupName, ConfigurationProfilePreference parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string configurationProfileName, string resourceGroupName, ConfigurationProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (configurationProfilePreferenceName == null)
+ if (configurationProfileName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfilePreferenceName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
if (parameters == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -119,7 +141,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("configurationProfilePreferenceName", configurationProfilePreferenceName);
+ tracingParameters.Add("configurationProfileName", configurationProfileName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
@@ -127,8 +149,8 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences/{configurationProfilePreferenceName}").ToString();
- _url = _url.Replace("{configurationProfilePreferenceName}", System.Uri.EscapeDataString(configurationProfilePreferenceName));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}").ToString();
+ _url = _url.Replace("{configurationProfileName}", System.Uri.EscapeDataString(configurationProfileName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
List _queryParameters = new List();
@@ -230,7 +252,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -243,7 +265,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -261,7 +283,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -281,13 +303,13 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
///
- /// Get information about a configuration profile preference
+ /// Get information about a configuration profile
///
- ///
- /// The configuration profile preference name.
+ ///
+ /// The configuration profile name.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// Headers that will be added to request.
@@ -310,31 +332,49 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string configurationProfilePreferenceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string configurationProfileName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (configurationProfilePreferenceName == null)
+ if (configurationProfileName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfilePreferenceName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -342,15 +382,15 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("configurationProfilePreferenceName", configurationProfilePreferenceName);
+ tracingParameters.Add("configurationProfileName", configurationProfileName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences/{configurationProfilePreferenceName}").ToString();
- _url = _url.Replace("{configurationProfilePreferenceName}", System.Uri.EscapeDataString(configurationProfilePreferenceName));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}").ToString();
+ _url = _url.Replace("{configurationProfileName}", System.Uri.EscapeDataString(configurationProfileName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
List _queryParameters = new List();
@@ -446,7 +486,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -459,7 +499,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -479,13 +519,13 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
///
- /// Delete a configuration profile preference
+ /// Delete a configuration profile
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
- ///
- /// Name of the configuration profile preference
+ ///
+ /// Name of the configuration profile
///
///
/// Headers that will be added to request.
@@ -505,7 +545,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string configurationProfilePreferenceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string configurationProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -513,23 +553,41 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
- if (configurationProfilePreferenceName == null)
+ if (configurationProfileName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfilePreferenceName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -538,15 +596,15 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("configurationProfilePreferenceName", configurationProfilePreferenceName);
+ tracingParameters.Add("configurationProfileName", configurationProfileName);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences/{configurationProfilePreferenceName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{configurationProfilePreferenceName}", System.Uri.EscapeDataString(configurationProfilePreferenceName));
+ _url = _url.Replace("{configurationProfileName}", System.Uri.EscapeDataString(configurationProfileName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (Client.ApiVersion != null)
@@ -656,16 +714,16 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
///
- /// Updates a configuration profile preference
+ /// Updates a configuration profile
///
- ///
- /// Name of the configuration profile preference.
+ ///
+ /// Name of the configuration profile.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
- /// Parameters supplied to create or update configuration profile preference.
+ /// Parameters supplied to update configuration profile.
///
///
/// Headers that will be added to request.
@@ -688,31 +746,49 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> UpdateWithHttpMessagesAsync(string configurationProfilePreferenceName, string resourceGroupName, ConfigurationProfilePreference parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string configurationProfileName, string resourceGroupName, ConfigurationProfileUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (configurationProfilePreferenceName == null)
+ if (configurationProfileName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfilePreferenceName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
if (parameters == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
@@ -724,7 +800,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("configurationProfilePreferenceName", configurationProfilePreferenceName);
+ tracingParameters.Add("configurationProfileName", configurationProfileName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
@@ -732,8 +808,8 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences/{configurationProfilePreferenceName}").ToString();
- _url = _url.Replace("{configurationProfilePreferenceName}", System.Uri.EscapeDataString(configurationProfilePreferenceName));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}").ToString();
+ _url = _url.Replace("{configurationProfileName}", System.Uri.EscapeDataString(configurationProfileName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
List _queryParameters = new List();
@@ -835,7 +911,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -848,7 +924,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -868,11 +944,10 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
///
- /// Retrieve a list of configuration profile preferences within a given
- /// resource group
+ /// Retrieve a list of configuration profile within a given resource group
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// Headers that will be added to request.
@@ -895,27 +970,45 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -929,7 +1022,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfilePreferences").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
List _queryParameters = new List();
@@ -1025,7 +1118,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1038,7 +1131,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1058,7 +1151,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
///
- /// Retrieve a list of configuration profile preferences within a subscription
+ /// Retrieve a list of configuration profile within a subscription
///
///
/// Headers that will be added to request.
@@ -1081,16 +1174,30 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1103,7 +1210,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Automanage/configurationProfilePreferences").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Automanage/configurationProfiles").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (Client.ApiVersion != null)
@@ -1198,7 +1305,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1211,7 +1318,7 @@ internal ConfigurationProfilePreferencesOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilePreferencesOperationsExtensions.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilesOperationsExtensions.cs
similarity index 52%
rename from sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilePreferencesOperationsExtensions.cs
rename to sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilesOperationsExtensions.cs
index f4289cba50a5..528f06ac449f 100644
--- a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilePreferencesOperationsExtensions.cs
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilesOperationsExtensions.cs
@@ -19,208 +19,206 @@ namespace Microsoft.Azure.Management.Automanage
using System.Threading.Tasks;
///
- /// Extension methods for ConfigurationProfilePreferencesOperations.
+ /// Extension methods for ConfigurationProfilesOperations.
///
- public static partial class ConfigurationProfilePreferencesOperationsExtensions
+ public static partial class ConfigurationProfilesOperationsExtensions
{
///
- /// Creates a configuration profile preference
+ /// Creates a configuration profile
///
///
/// The operations group for this extension method.
///
- ///
- /// Name of the configuration profile preference.
+ ///
+ /// Name of the configuration profile.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
- /// Parameters supplied to create or update configuration profile preference.
+ /// Parameters supplied to create or update configuration profile.
///
- public static ConfigurationProfilePreference CreateOrUpdate(this IConfigurationProfilePreferencesOperations operations, string configurationProfilePreferenceName, string resourceGroupName, ConfigurationProfilePreference parameters)
+ public static ConfigurationProfile CreateOrUpdate(this IConfigurationProfilesOperations operations, string configurationProfileName, string resourceGroupName, ConfigurationProfile parameters)
{
- return operations.CreateOrUpdateAsync(configurationProfilePreferenceName, resourceGroupName, parameters).GetAwaiter().GetResult();
+ return operations.CreateOrUpdateAsync(configurationProfileName, resourceGroupName, parameters).GetAwaiter().GetResult();
}
///
- /// Creates a configuration profile preference
+ /// Creates a configuration profile
///
///
/// The operations group for this extension method.
///
- ///
- /// Name of the configuration profile preference.
+ ///
+ /// Name of the configuration profile.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
- /// Parameters supplied to create or update configuration profile preference.
+ /// Parameters supplied to create or update configuration profile.
///
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateAsync(this IConfigurationProfilePreferencesOperations operations, string configurationProfilePreferenceName, string resourceGroupName, ConfigurationProfilePreference parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateAsync(this IConfigurationProfilesOperations operations, string configurationProfileName, string resourceGroupName, ConfigurationProfile parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(configurationProfilePreferenceName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(configurationProfileName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Get information about a configuration profile preference
+ /// Get information about a configuration profile
///
///
/// The operations group for this extension method.
///
- ///
- /// The configuration profile preference name.
+ ///
+ /// The configuration profile name.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
- public static ConfigurationProfilePreference Get(this IConfigurationProfilePreferencesOperations operations, string configurationProfilePreferenceName, string resourceGroupName)
+ public static ConfigurationProfile Get(this IConfigurationProfilesOperations operations, string configurationProfileName, string resourceGroupName)
{
- return operations.GetAsync(configurationProfilePreferenceName, resourceGroupName).GetAwaiter().GetResult();
+ return operations.GetAsync(configurationProfileName, resourceGroupName).GetAwaiter().GetResult();
}
///
- /// Get information about a configuration profile preference
+ /// Get information about a configuration profile
///
///
/// The operations group for this extension method.
///
- ///
- /// The configuration profile preference name.
+ ///
+ /// The configuration profile name.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IConfigurationProfilePreferencesOperations operations, string configurationProfilePreferenceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IConfigurationProfilesOperations operations, string configurationProfileName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(configurationProfilePreferenceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(configurationProfileName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Delete a configuration profile preference
+ /// Delete a configuration profile
///
///
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
- ///
- /// Name of the configuration profile preference
+ ///
+ /// Name of the configuration profile
///
- public static void Delete(this IConfigurationProfilePreferencesOperations operations, string resourceGroupName, string configurationProfilePreferenceName)
+ public static void Delete(this IConfigurationProfilesOperations operations, string resourceGroupName, string configurationProfileName)
{
- operations.DeleteAsync(resourceGroupName, configurationProfilePreferenceName).GetAwaiter().GetResult();
+ operations.DeleteAsync(resourceGroupName, configurationProfileName).GetAwaiter().GetResult();
}
///
- /// Delete a configuration profile preference
+ /// Delete a configuration profile
///
///
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
- ///
- /// Name of the configuration profile preference
+ ///
+ /// Name of the configuration profile
///
///
/// The cancellation token.
///
- public static async Task DeleteAsync(this IConfigurationProfilePreferencesOperations operations, string resourceGroupName, string configurationProfilePreferenceName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task DeleteAsync(this IConfigurationProfilesOperations operations, string resourceGroupName, string configurationProfileName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, configurationProfilePreferenceName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, configurationProfileName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
- /// Updates a configuration profile preference
+ /// Updates a configuration profile
///
///
/// The operations group for this extension method.
///
- ///
- /// Name of the configuration profile preference.
+ ///
+ /// Name of the configuration profile.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
- /// Parameters supplied to create or update configuration profile preference.
+ /// Parameters supplied to update configuration profile.
///
- public static ConfigurationProfilePreference Update(this IConfigurationProfilePreferencesOperations operations, string configurationProfilePreferenceName, string resourceGroupName, ConfigurationProfilePreference parameters)
+ public static ConfigurationProfile Update(this IConfigurationProfilesOperations operations, string configurationProfileName, string resourceGroupName, ConfigurationProfileUpdate parameters)
{
- return operations.UpdateAsync(configurationProfilePreferenceName, resourceGroupName, parameters).GetAwaiter().GetResult();
+ return operations.UpdateAsync(configurationProfileName, resourceGroupName, parameters).GetAwaiter().GetResult();
}
///
- /// Updates a configuration profile preference
+ /// Updates a configuration profile
///
///
/// The operations group for this extension method.
///
- ///
- /// Name of the configuration profile preference.
+ ///
+ /// Name of the configuration profile.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
- /// Parameters supplied to create or update configuration profile preference.
+ /// Parameters supplied to update configuration profile.
///
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IConfigurationProfilePreferencesOperations operations, string configurationProfilePreferenceName, string resourceGroupName, ConfigurationProfilePreference parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IConfigurationProfilesOperations operations, string configurationProfileName, string resourceGroupName, ConfigurationProfileUpdate parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.UpdateWithHttpMessagesAsync(configurationProfilePreferenceName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(configurationProfileName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Retrieve a list of configuration profile preferences within a given
- /// resource group
+ /// Retrieve a list of configuration profile within a given resource group
///
///
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
- public static IEnumerable ListByResourceGroup(this IConfigurationProfilePreferencesOperations operations, string resourceGroupName)
+ public static IEnumerable ListByResourceGroup(this IConfigurationProfilesOperations operations, string resourceGroupName)
{
return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult();
}
///
- /// Retrieve a list of configuration profile preferences within a given
- /// resource group
+ /// Retrieve a list of configuration profile within a given resource group
///
///
/// The operations group for this extension method.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The cancellation token.
///
- public static async Task> ListByResourceGroupAsync(this IConfigurationProfilePreferencesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByResourceGroupAsync(this IConfigurationProfilesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
{
@@ -229,18 +227,18 @@ public static IEnumerable ListByResourceGroup(th
}
///
- /// Retrieve a list of configuration profile preferences within a subscription
+ /// Retrieve a list of configuration profile within a subscription
///
///
/// The operations group for this extension method.
///
- public static IEnumerable ListBySubscription(this IConfigurationProfilePreferencesOperations operations)
+ public static IEnumerable ListBySubscription(this IConfigurationProfilesOperations operations)
{
return operations.ListBySubscriptionAsync().GetAwaiter().GetResult();
}
///
- /// Retrieve a list of configuration profile preferences within a subscription
+ /// Retrieve a list of configuration profile within a subscription
///
///
/// The operations group for this extension method.
@@ -248,7 +246,7 @@ public static IEnumerable ListBySubscription(thi
///
/// The cancellation token.
///
- public static async Task> ListBySubscriptionAsync(this IConfigurationProfilePreferencesOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListBySubscriptionAsync(this IConfigurationProfilesOperations operations, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
{
diff --git a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AccountsOperations.cs b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilesVersionsOperations.cs
similarity index 79%
rename from sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AccountsOperations.cs
rename to sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilesVersionsOperations.cs
index 65b8232de9d2..411a8ea7f7fd 100644
--- a/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/AccountsOperations.cs
+++ b/sdk/automanage/Microsoft.Azure.Management.Automanage/src/Generated/ConfigurationProfilesVersionsOperations.cs
@@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Automanage
using System.Threading.Tasks;
///
- /// AccountsOperations operations.
+ /// ConfigurationProfilesVersionsOperations operations.
///
- internal partial class AccountsOperations : IServiceOperations, IAccountsOperations
+ internal partial class ConfigurationProfilesVersionsOperations : IServiceOperations, IConfigurationProfilesVersionsOperations
{
///
- /// Initializes a new instance of the AccountsOperations class.
+ /// Initializes a new instance of the ConfigurationProfilesVersionsOperations class.
///
///
/// Reference to the service client.
@@ -36,7 +36,7 @@ internal partial class AccountsOperations : IServiceOperations
///
/// Thrown when a required parameter is null
///
- internal AccountsOperations(AutomanageClient client)
+ internal ConfigurationProfilesVersionsOperations(AutomanageClient client)
{
if (client == null)
{
@@ -51,16 +51,19 @@ internal AccountsOperations(AutomanageClient client)
public AutomanageClient Client { get; private set; }
///
- /// Creates an Automanage Account
+ /// Creates a configuration profile version
///
- ///
- /// Name of the Automanage account.
+ ///
+ /// Name of the configuration profile.
+ ///
+ ///
+ /// The configuration profile version name.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
- /// Parameters supplied to create or update Automanage account.
+ /// Parameters supplied to create or update configuration profile.
///
///
/// Headers that will be added to request.
@@ -83,35 +86,61 @@ internal AccountsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string accountName, string resourceGroupName, Account parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string configurationProfileName, string versionName, string resourceGroupName, ConfigurationProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (accountName == null)
+ if (configurationProfileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileName");
+ }
+ if (versionName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "versionName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
if (parameters == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -119,7 +148,8 @@ internal AccountsOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("configurationProfileName", configurationProfileName);
+ tracingParameters.Add("versionName", versionName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
@@ -127,8 +157,9 @@ internal AccountsOperations(AutomanageClient client)
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}").ToString();
- _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions/{versionName}").ToString();
+ _url = _url.Replace("{configurationProfileName}", System.Uri.EscapeDataString(configurationProfileName));
+ _url = _url.Replace("{versionName}", System.Uri.EscapeDataString(versionName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
List _queryParameters = new List();
@@ -230,7 +261,7 @@ internal AccountsOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -243,7 +274,7 @@ internal AccountsOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -261,7 +292,7 @@ internal AccountsOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -281,13 +312,16 @@ internal AccountsOperations(AutomanageClient client)
}
///
- /// Get information about a Automanage account
+ /// Get information about a configuration profile version
///
- ///
- /// The Automanage account name.
+ ///
+ /// The configuration profile name.
+ ///
+ ///
+ /// The configuration profile version name.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// Headers that will be added to request.
@@ -310,31 +344,53 @@ internal AccountsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string accountName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string configurationProfileName, string versionName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (accountName == null)
+ if (configurationProfileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileName");
+ }
+ if (versionName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "versionName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -342,15 +398,17 @@ internal AccountsOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("configurationProfileName", configurationProfileName);
+ tracingParameters.Add("versionName", versionName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}").ToString();
- _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions/{versionName}").ToString();
+ _url = _url.Replace("{configurationProfileName}", System.Uri.EscapeDataString(configurationProfileName));
+ _url = _url.Replace("{versionName}", System.Uri.EscapeDataString(versionName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
List _queryParameters = new List();
@@ -446,7 +504,7 @@ internal AccountsOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -459,7 +517,7 @@ internal AccountsOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -479,13 +537,16 @@ internal AccountsOperations(AutomanageClient client)
}
///
- /// Delete a Automanage account
+ /// Delete a configuration profile version
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
- ///
- /// Name of the Automanage account
+ ///
+ /// Name of the configuration profile
+ ///
+ ///
+ /// The configuration profile version name.
///
///
/// Headers that will be added to request.
@@ -505,7 +566,7 @@ internal AccountsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string configurationProfileName, string versionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -513,23 +574,45 @@ internal AccountsOperations(AutomanageClient client)
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
- if (accountName == null)
+ if (configurationProfileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileName");
+ }
+ if (versionName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "versionName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -538,15 +621,17 @@ internal AccountsOperations(AutomanageClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("configurationProfileName", configurationProfileName);
+ tracingParameters.Add("versionName", versionName);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions/{versionName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
+ _url = _url.Replace("{configurationProfileName}", System.Uri.EscapeDataString(configurationProfileName));
+ _url = _url.Replace("{versionName}", System.Uri.EscapeDataString(versionName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (Client.ApiVersion != null)
@@ -656,16 +741,19 @@ internal AccountsOperations(AutomanageClient client)
}
///
- /// Updates an Automanage Account
+ /// Updates a configuration profile version
///
- ///
- /// Name of the Automanage account.
+ ///
+ /// Name of the configuration profile.
+ ///
+ ///
+ /// The configuration profile version name.
///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
- /// Parameters supplied to update Automanage account.
+ /// Parameters supplied to update configuration profile.
///
///
/// Headers that will be added to request.
@@ -688,31 +776,53 @@ internal AccountsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> UpdateWithHttpMessagesAsync(string accountName, string resourceGroupName, Account parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string configurationProfileName, string versionName, string resourceGroupName, ConfigurationProfileUpdate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (accountName == null)
+ if (configurationProfileName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "accountName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileName");
+ }
+ if (versionName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "versionName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
{
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
if (parameters == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
@@ -724,7 +834,8 @@ internal AccountsOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("accountName", accountName);
+ tracingParameters.Add("configurationProfileName", configurationProfileName);
+ tracingParameters.Add("versionName", versionName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
@@ -732,8 +843,9 @@ internal AccountsOperations(AutomanageClient client)
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}").ToString();
- _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions/{versionName}").ToString();
+ _url = _url.Replace("{configurationProfileName}", System.Uri.EscapeDataString(configurationProfileName));
+ _url = _url.Replace("{versionName}", System.Uri.EscapeDataString(versionName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
List _queryParameters = new List();
@@ -835,7 +947,7 @@ internal AccountsOperations(AutomanageClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -848,7 +960,7 @@ internal AccountsOperations(AutomanageClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -868,10 +980,14 @@ internal AccountsOperations(AutomanageClient client)
}
///
- /// Retrieve a list of Automanage accounts within a given resource group
+ /// Retrieve a list of configuration profile version for a configuration
+ /// profile
///
+ ///
+ /// Name of the configuration profile.
+ ///
///
- /// The resource group name.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// Headers that will be added to request.
@@ -894,201 +1010,48 @@ internal AccountsOperations(AutomanageClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListChildResourcesWithHttpMessagesAsync(string configurationProfileName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (Client.SubscriptionId == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
- }
- if (resourceGroupName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
- }
- if (resourceGroupName != null)
- {
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$");
- }
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters);
- }
- // Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+ if (configurationProfileName == null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ throw new ValidationException(ValidationRules.CannotBeNull, "configurationProfileName");
}
- if (_queryParameters.Count > 0)
- {
- _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
- }
- // Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
- _httpRequest.RequestUri = new System.Uri(_url);
- // Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (Client.SubscriptionId == null)
{
- _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.AcceptLanguage != null)
+ if (Client.SubscriptionId != null)
{
- if (_httpRequest.Headers.Contains("accept-language"))
+ if (Client.SubscriptionId.Length < 1)
{
- _httpRequest.Headers.Remove("accept-language");
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
}
-
-
- if (customHeaders != null)
- {
- foreach(var _header in customHeaders)
- {
- if (_httpRequest.Headers.Contains(_header.Key))
- {
- _httpRequest.Headers.Remove(_header.Key);
- }
- _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
- }
- }
-
- // Serialize Request
- string _requestContent = null;
- // Set Credentials
- if (Client.Credentials != null)
- {
- cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- }
- // Send Request
- if (_shouldTrace)
- {
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
- }
- cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
- if (_shouldTrace)
+ if (resourceGroupName == null)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
- cancellationToken.ThrowIfCancellationRequested();
- string _responseContent = null;
- if ((int)_statusCode != 200)
+ if (resourceGroupName != null)
{
- var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- try
+ if (resourceGroupName.Length > 90)
{
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- if (_errorBody != null)
- {
- ex.Body = _errorBody;
- }
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
}
- catch (JsonException)
+ if (resourceGroupName.Length < 1)
{
- // Ignore the exception
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_shouldTrace)
- {
- ServiceClientTracing.Error(_invocationId, ex);
- }
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw ex;
}
- // Create Result
- var _result = new AzureOperationResponse>();
- _result.Request = _httpRequest;
- _result.Response = _httpResponse;
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ if (Client.ApiVersion == null)
{
- _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
- // Deserialize Response
- if ((int)_statusCode == 200)
+ if (Client.ApiVersion != null)
{
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
+ if (Client.ApiVersion.Length < 1)
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
}
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
- if (_shouldTrace)
- {
- ServiceClientTracing.Exit(_invocationId, _result);
- }
- return _result;
- }
-
- ///
- /// Retrieve a list of Automanage accounts 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 Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (Client.SubscriptionId == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
- }
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1097,13 +1060,17 @@ internal AccountsOperations(AutomanageClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("configurationProfileName", configurationProfileName);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListChildResources", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Automanage/accounts").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/configurationProfiles/{configurationProfileName}/versions").ToString();
+ _url = _url.Replace("{configurationProfileName}", System.Uri.EscapeDataString(configurationProfileName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
List