/// <summary>
 /// Gets a resource permissions.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IPermissionOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group. The name is case
 /// insensitive.
 /// </param>
 /// <param name='identity'>
 /// Required. Resource
 /// </param>
 /// <returns>
 /// Permissions information.
 /// </returns>
 public static PermissionGetResult ListForResource(this IPermissionOperations operations, string resourceGroupName, ResourceIdentity identity)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IPermissionOperations)s).ListForResourceAsync(resourceGroupName, identity);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Gets a resource permissions.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IPermissionOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group. The name is case
 /// insensitive.
 /// </param>
 /// <param name='identity'>
 /// Required. Resource
 /// </param>
 /// <returns>
 /// Permissions information.
 /// </returns>
 public static Task<PermissionGetResult> ListForResourceAsync(this IPermissionOperations operations, string resourceGroupName, ResourceIdentity identity)
 {
     return operations.ListForResourceAsync(resourceGroupName, identity, CancellationToken.None);
 }
 /// <summary>
 /// Gets role assignments of the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='identity'>
 /// Required. Resource identity.
 /// </param>
 /// <param name='parameters'>
 /// Optional. List operation filters. If null will return all role
 /// assignments at, above or below the resource.
 /// </param>
 /// <returns>
 /// Role assignment list operation result.
 /// </returns>
 public static Task<RoleAssignmentListResult> ListForResourceAsync(this IRoleAssignmentOperations operations, string resourceGroupName, ResourceIdentity identity, ListAssignmentsFilterParameters parameters)
 {
     return operations.ListForResourceAsync(resourceGroupName, identity, parameters, CancellationToken.None);
 }
 /// <summary>
 /// Gets role assignments of the resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Authorization.IRoleAssignmentOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='identity'>
 /// Required. Resource identity.
 /// </param>
 /// <param name='parameters'>
 /// Optional. List operation filters. If null will return all role
 /// assignments at, above or below the resource.
 /// </param>
 /// <returns>
 /// Role assignment list operation result.
 /// </returns>
 public static RoleAssignmentListResult ListForResource(this IRoleAssignmentOperations operations, string resourceGroupName, ResourceIdentity identity, ListAssignmentsFilterParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IRoleAssignmentOperations)s).ListForResourceAsync(resourceGroupName, identity, parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }