/// <summary>
 /// The Create Or Update Protected Item Operation is used to enable
 /// protection of an item within a container or to modify the
 /// protection of an already protected item. In the case of enable
 /// protection, this operation creates a new protected item entity in
 /// the backend service. In the case of modify protection, this
 /// operation updates the already created entity in the backend
 /// service. This is an asynchronous operation. To determine whether
 /// the backend service has finished processing the request, call the
 /// Get Item Operation Result API.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RecoveryServices.Backup.IProtectedItemOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. Resource group name of your recovery services vault.
 /// </param>
 /// <param name='resourceName'>
 /// Required. Name of your recovery services vault.
 /// </param>
 /// <param name='fabricName'>
 /// Required. Fabric name of the protected item.
 /// </param>
 /// <param name='containerName'>
 /// Required. Name of the container where the protected item belongs to.
 /// </param>
 /// <param name='protectedItemName'>
 /// Required. Name of the protected item which has to be backed up.
 /// </param>
 /// <param name='request'>
 /// Required.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// Base recovery job response for all the asynchronous operations.
 /// </returns>
 public static BaseRecoveryServicesJobResponse CreateOrUpdateProtectedItem(this IProtectedItemOperations operations, string resourceGroupName, string resourceName, string fabricName, string containerName, string protectedItemName, ProtectedItemCreateOrUpdateRequest request, CustomRequestHeaders customRequestHeaders)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IProtectedItemOperations)s).CreateOrUpdateProtectedItemAsync(resourceGroupName, resourceName, fabricName, containerName, protectedItemName, request, customRequestHeaders);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists all the items protected by your Recovery Services Vault
 /// according to the query and pagination parameters supplied in the
 /// arguments.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RecoveryServices.Backup.IProtectedItemOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. Resource group name of your recovery services vault.
 /// </param>
 /// <param name='resourceName'>
 /// Required. Name of your recovery services vault.
 /// </param>
 /// <param name='queryFilter'>
 /// Optional.
 /// </param>
 /// <param name='paginationParams'>
 /// Optional.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// List of protected items returned as a response by the list
 /// protected item API.
 /// </returns>
 public static ProtectedItemListResponse List(this IProtectedItemOperations operations, string resourceGroupName, string resourceName, ProtectedItemListQueryParam queryFilter, PaginationRequest paginationParams, CustomRequestHeaders customRequestHeaders)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IProtectedItemOperations)s).ListAsync(resourceGroupName, resourceName, queryFilter, paginationParams, customRequestHeaders);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Fetches the result of any operation on the protected item given the
 /// URL for tracking the operation as returned by APIs such as Create
 /// Or Update, Delete etc.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RecoveryServices.Backup.IProtectedItemOperations.
 /// </param>
 /// <param name='operationResultLink'>
 /// Required. Location value returned by operation.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// A single instance of a protected item response.
 /// </returns>
 public static ProtectedItemResponse GetProtectedItemOperationResultByURL(this IProtectedItemOperations operations, string operationResultLink, CustomRequestHeaders customRequestHeaders)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IProtectedItemOperations)s).GetProtectedItemOperationResultByURLAsync(operationResultLink, customRequestHeaders);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Fetches the result of any operation on the protected item given the
 /// ID of operation.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RecoveryServices.Backup.IProtectedItemOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. Resource group name of your recovery services vault.
 /// </param>
 /// <param name='resourceName'>
 /// Required. Name of your recovery services vault.
 /// </param>
 /// <param name='fabricName'>
 /// Required.
 /// </param>
 /// <param name='containerName'>
 /// Required.
 /// </param>
 /// <param name='protectedItemName'>
 /// Required.
 /// </param>
 /// <param name='operationId'>
 /// Required.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// A single instance of a protected item response.
 /// </returns>
 public static ProtectedItemResponse GetOperationResult(this IProtectedItemOperations operations, string resourceGroupName, string resourceName, string fabricName, string containerName, string protectedItemName, string operationId, CustomRequestHeaders customRequestHeaders)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IProtectedItemOperations)s).GetOperationResultAsync(resourceGroupName, resourceName, fabricName, containerName, protectedItemName, operationId, customRequestHeaders);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists all the items protected by your Recovery Services Vault
 /// according to the query and pagination parameters supplied in the
 /// arguments.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RecoveryServices.Backup.IProtectedItemOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. Resource group name of your recovery services vault.
 /// </param>
 /// <param name='resourceName'>
 /// Required. Name of your recovery services vault.
 /// </param>
 /// <param name='queryFilter'>
 /// Optional.
 /// </param>
 /// <param name='paginationParams'>
 /// Optional.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// List of protected items returned as a response by the list
 /// protected item API.
 /// </returns>
 public static Task <ProtectedItemListResponse> ListAsync(this IProtectedItemOperations operations, string resourceGroupName, string resourceName, ProtectedItemListQueryParam queryFilter, PaginationRequest paginationParams, CustomRequestHeaders customRequestHeaders)
 {
     return(operations.ListAsync(resourceGroupName, resourceName, queryFilter, paginationParams, customRequestHeaders, CancellationToken.None));
 }
 /// <summary>
 /// Fetches the result of any operation on the protected item given the
 /// URL for tracking the operation as returned by APIs such as Create
 /// Or Update, Delete etc.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RecoveryServices.Backup.IProtectedItemOperations.
 /// </param>
 /// <param name='operationResultLink'>
 /// Required. Location value returned by operation.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// A single instance of a protected item response.
 /// </returns>
 public static Task <ProtectedItemResponse> GetProtectedItemOperationResultByURLAsync(this IProtectedItemOperations operations, string operationResultLink, CustomRequestHeaders customRequestHeaders)
 {
     return(operations.GetProtectedItemOperationResultByURLAsync(operationResultLink, customRequestHeaders, CancellationToken.None));
 }
 /// <summary>
 /// Fetches the result of any operation on the protected item given the
 /// ID of operation.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RecoveryServices.Backup.IProtectedItemOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. Resource group name of your recovery services vault.
 /// </param>
 /// <param name='resourceName'>
 /// Required. Name of your recovery services vault.
 /// </param>
 /// <param name='fabricName'>
 /// Required.
 /// </param>
 /// <param name='containerName'>
 /// Required.
 /// </param>
 /// <param name='protectedItemName'>
 /// Required.
 /// </param>
 /// <param name='operationId'>
 /// Required.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// A single instance of a protected item response.
 /// </returns>
 public static Task <ProtectedItemResponse> GetOperationResultAsync(this IProtectedItemOperations operations, string resourceGroupName, string resourceName, string fabricName, string containerName, string protectedItemName, string operationId, CustomRequestHeaders customRequestHeaders)
 {
     return(operations.GetOperationResultAsync(resourceGroupName, resourceName, fabricName, containerName, protectedItemName, operationId, customRequestHeaders, CancellationToken.None));
 }
 /// <summary>
 /// The Delete Protected Item Operation is used to disable protection
 /// of an item within a container. This operation marks the already
 /// existing protected item entity as not protected in the backend
 /// service. This is an asynchronous operation. To determine whether
 /// the backend service has finished processing the request, call the
 /// Get Item Operation Result API.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RecoveryServices.Backup.IProtectedItemOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. Resource group name of your recovery services vault.
 /// </param>
 /// <param name='resourceName'>
 /// Required. Name of your recovery services vault.
 /// </param>
 /// <param name='fabricName'>
 /// Required. Fabric name of the protected item.
 /// </param>
 /// <param name='containerName'>
 /// Required. Name of the container where the protected item belongs to.
 /// </param>
 /// <param name='protectedItemName'>
 /// Required. Name of the protected item which has to be backed up.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Required. Request header parameters.
 /// </param>
 /// <returns>
 /// Base recovery job response for all the asynchronous operations.
 /// </returns>
 public static Task <BaseRecoveryServicesJobResponse> DeleteProtectedItemAsync(this IProtectedItemOperations operations, string resourceGroupName, string resourceName, string fabricName, string containerName, string protectedItemName, CustomRequestHeaders customRequestHeaders)
 {
     return(operations.DeleteProtectedItemAsync(resourceGroupName, resourceName, fabricName, containerName, protectedItemName, customRequestHeaders, CancellationToken.None));
 }