// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

namespace AutorestClient
{
    using Models;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for UnAssignRolesOperations.
    /// </summary>
    public static partial class UnAssignRolesOperationsExtensions
    {
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='userName'>
            /// </param>
            /// <param name='permissions'>
            /// </param>
            /// <param name='roles'>
            /// </param>
            public static UnAssignRolesResponse Get(this IUnAssignRolesOperations operations, string userName = default(string), string permissions = default(string), string roles = default(string))
            {
                return operations.GetAsync(userName, permissions, roles).GetAwaiter().GetResult();
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='userName'>
            /// </param>
            /// <param name='permissions'>
            /// </param>
            /// <param name='roles'>
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<UnAssignRolesResponse> GetAsync(this IUnAssignRolesOperations operations, string userName = default(string), string permissions = default(string), string roles = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(userName, permissions, roles, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='userName'>
            /// </param>
            /// <param name='permissions'>
            /// </param>
            /// <param name='roles'>
            /// </param>
            /// <param name='body'>
            /// </param>
            public static UnAssignRolesResponse Create(this IUnAssignRolesOperations operations, string userName = default(string), string permissions = default(string), string roles = default(string), UnAssignRoles body = default(UnAssignRoles))
            {
                return operations.CreateAsync(userName, permissions, roles, body).GetAwaiter().GetResult();
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='userName'>
            /// </param>
            /// <param name='permissions'>
            /// </param>
            /// <param name='roles'>
            /// </param>
            /// <param name='body'>
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<UnAssignRolesResponse> CreateAsync(this IUnAssignRolesOperations operations, string userName = default(string), string permissions = default(string), string roles = default(string), UnAssignRoles body = default(UnAssignRoles), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateWithHttpMessagesAsync(userName, permissions, roles, body, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='userName'>
            /// </param>
            /// <param name='permissions'>
            /// </param>
            /// <param name='roles'>
            /// </param>
            /// <param name='body'>
            /// </param>
            public static UnAssignRolesResponse Post(this IUnAssignRolesOperations operations, string userName = default(string), string permissions = default(string), string roles = default(string), UnAssignRoles body = default(UnAssignRoles))
            {
                return operations.PostAsync(userName, permissions, roles, body).GetAwaiter().GetResult();
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='userName'>
            /// </param>
            /// <param name='permissions'>
            /// </param>
            /// <param name='roles'>
            /// </param>
            /// <param name='body'>
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<UnAssignRolesResponse> PostAsync(this IUnAssignRolesOperations operations, string userName = default(string), string permissions = default(string), string roles = default(string), UnAssignRoles body = default(UnAssignRoles), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.PostWithHttpMessagesAsync(userName, permissions, roles, body, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='userName'>
            /// </param>
            /// <param name='permissions'>
            /// </param>
            /// <param name='roles'>
            /// </param>
            public static UnAssignRolesResponse Delete(this IUnAssignRolesOperations operations, string userName = default(string), string permissions = default(string), string roles = default(string))
            {
                return operations.DeleteAsync(userName, permissions, roles).GetAwaiter().GetResult();
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='userName'>
            /// </param>
            /// <param name='permissions'>
            /// </param>
            /// <param name='roles'>
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<UnAssignRolesResponse> DeleteAsync(this IUnAssignRolesOperations operations, string userName = default(string), string permissions = default(string), string roles = default(string), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.DeleteWithHttpMessagesAsync(userName, permissions, roles, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

    }
}
