/// <summary>
 /// Create a credential.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure Resource group.
 /// </param>
 /// <param name='automationAccountName'>
 /// The name of the automation account.
 /// </param>
 /// <param name='credentialName'>
 /// The parameters supplied to the create or update credential operation.
 /// </param>
 /// <param name='parameters'>
 /// The parameters supplied to the create or update credential operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Credential> CreateOrUpdateAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, credentialName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Create a credential.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the create or update
 /// credential operation.
 /// </param>
 /// <returns>
 /// The response model for the create or update credential operation.
 /// </returns>
 public static Task <CredentialCreateOrUpdateResponse> CreateOrUpdateAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccount, CredentialCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, automationAccount, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Create a credential.
 /// <see href="http://aka.ms/azureautomationsdk/credentialoperations" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of an Azure Resource group.
 /// </param>
 /// <param name='automationAccountName'>
 /// The name of the automation account.
 /// </param>
 /// <param name='credentialName'>
 /// The parameters supplied to the create or update credential operation.
 /// </param>
 /// <param name='parameters'>
 /// The parameters supplied to the create or update credential operation.
 /// </param>
 public static Credential CreateOrUpdate(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, credentialName, parameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create a credential.  (see
 /// http://aka.ms/azureautomationsdk/credentialoperations for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.ICredentialOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the create or update
 /// credential operation.
 /// </param>
 /// <returns>
 /// The response model for the create or update credential operation.
 /// </returns>
 public static CredentialCreateOrUpdateResponse CreateOrUpdate(this ICredentialOperations operations, string resourceGroupName, string automationAccount, CredentialCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ICredentialOperations)s).CreateOrUpdateAsync(resourceGroupName, automationAccount, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }