Skip to content

Commit

Permalink
.NET SDK Resource Provider:'Automation'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5934'
REST Spec PR Author 'lmazuel'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed May 13, 2019
1 parent 80f0eb6 commit 3f5fc49
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ public partial class AutomationClient : ServiceClient<AutomationClient>, IAutoma
/// </summary>
public string SubscriptionId { get; set; }

/// <summary>
/// The type of counts to retrieve. Possible values include: 'status',
/// 'nodeconfiguration'
/// </summary>
public string CountType1 { get; set; }

/// <summary>
/// The preferred language for the response.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ public partial interface IAutomationClient : System.IDisposable
/// </summary>
string SubscriptionId { get; set; }

/// <summary>
/// The type of counts to retrieve. Possible values include: 'status',
/// 'nodeconfiguration'
/// </summary>
string CountType1 { get; set; }

/// <summary>
/// The preferred language for the response.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public partial interface INodeCountInformationOperations
/// <param name='automationAccountName'>
/// The name of the automation account.
/// </param>
/// <param name='countType'>
/// The type of counts to retrieve. Possible values include: 'status',
/// 'nodeconfiguration'
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -48,6 +52,6 @@ public partial interface INodeCountInformationOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<NodeCounts>> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<NodeCounts>> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string countType, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ internal NodeCountInformationOperations(AutomationClient client)
/// <param name='automationAccountName'>
/// The name of the automation account.
/// </param>
/// <param name='countType'>
/// The type of counts to retrieve. Possible values include: 'status',
/// 'nodeconfiguration'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -81,7 +85,7 @@ internal NodeCountInformationOperations(AutomationClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<NodeCounts>> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<NodeCounts>> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string countType, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand All @@ -106,9 +110,9 @@ internal NodeCountInformationOperations(AutomationClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName");
}
if (Client.CountType1 == null)
if (countType == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.CountType1");
throw new ValidationException(ValidationRules.CannotBeNull, "countType");
}
if (Client.SubscriptionId == null)
{
Expand All @@ -124,6 +128,7 @@ internal NodeCountInformationOperations(AutomationClient client)
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("automationAccountName", automationAccountName);
tracingParameters.Add("countType", countType);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
Expand All @@ -133,7 +138,7 @@ internal NodeCountInformationOperations(AutomationClient client)
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodecounts/{countType}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName));
_url = _url.Replace("{countType}", System.Uri.EscapeDataString(Client.CountType1));
_url = _url.Replace("{countType}", System.Uri.EscapeDataString(countType));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ public static partial class NodeCountInformationOperationsExtensions
/// <param name='automationAccountName'>
/// The name of the automation account.
/// </param>
public static NodeCounts Get(this INodeCountInformationOperations operations, string resourceGroupName, string automationAccountName)
/// <param name='countType'>
/// The type of counts to retrieve. Possible values include: 'status',
/// 'nodeconfiguration'
/// </param>
public static NodeCounts Get(this INodeCountInformationOperations operations, string resourceGroupName, string automationAccountName, string countType)
{
return operations.GetAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult();
return operations.GetAsync(resourceGroupName, automationAccountName, countType).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -52,12 +56,16 @@ public static NodeCounts Get(this INodeCountInformationOperations operations, st
/// <param name='automationAccountName'>
/// The name of the automation account.
/// </param>
/// <param name='countType'>
/// The type of counts to retrieve. Possible values include: 'status',
/// 'nodeconfiguration'
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<NodeCounts> GetAsync(this INodeCountInformationOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken))
public static async Task<NodeCounts> GetAsync(this INodeCountInformationOperations operations, string resourceGroupName, string automationAccountName, string countType, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, countType, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
Expand Down

0 comments on commit 3f5fc49

Please sign in to comment.