/// <summary>
 /// Provides the details of the backup policies associated to Recovery Services
 /// Vault. This is an asynchronous
 /// operation. Status of the operation can be fetched using
 /// GetPolicyOperationResult API.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='vaultName'>
 /// The name of the recovery services vault.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group where the recovery services vault is
 /// present.
 /// </param>
 /// <param name='policyName'>
 /// Backup policy information to be fetched.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ProtectionPolicyResource> GetAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates or modifies a backup policy. This is an asynchronous operation.
 /// Status of the operation can be fetched
 /// using GetPolicyOperationResult API.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='vaultName'>
 /// The name of the recovery services vault.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group where the recovery services vault is
 /// present.
 /// </param>
 /// <param name='policyName'>
 /// Backup policy to be created.
 /// </param>
 /// <param name='parameters'>
 /// resource backup policy
 /// </param>
 public static ProtectionPolicyResource CreateOrUpdate(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters)
 {
     return(operations.CreateOrUpdateAsync(vaultName, resourceGroupName, policyName, parameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes specified backup policy from your Recovery Services Vault. This is
 /// an asynchronous operation. Status of the
 /// operation can be fetched using GetProtectionPolicyOperationResult API.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='vaultName'>
 /// The name of the recovery services vault.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group where the recovery services vault is
 /// present.
 /// </param>
 /// <param name='policyName'>
 /// Backup policy to be deleted.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Provides the details of the backup policies associated to Recovery Services
 /// Vault. This is an asynchronous
 /// operation. Status of the operation can be fetched using
 /// GetPolicyOperationResult API.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='vaultName'>
 /// The name of the recovery services vault.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group where the recovery services vault is
 /// present.
 /// </param>
 /// <param name='policyName'>
 /// Backup policy information to be fetched.
 /// </param>
 public static ProtectionPolicyResource Get(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName)
 {
     return(operations.GetAsync(vaultName, resourceGroupName, policyName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes specified backup policy from your Recovery Services Vault. This is
 /// an asynchronous operation. Status of the
 /// operation can be fetched using GetProtectionPolicyOperationResult API.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='vaultName'>
 /// The name of the recovery services vault.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group where the recovery services vault is
 /// present.
 /// </param>
 /// <param name='policyName'>
 /// Backup policy to be deleted.
 /// </param>
 public static void BeginDelete(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName)
 {
     operations.BeginDeleteAsync(vaultName, resourceGroupName, policyName).GetAwaiter().GetResult();
 }