// 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 HelloAllTypesWithResultOperations.
    /// </summary>
    public static partial class HelloAllTypesWithResultOperationsExtensions
    {
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='name'>
            /// </param>
            /// <param name='allTypes'>
            /// </param>
            /// <param name='allCollectionTypes'>
            /// </param>
            public static HelloAllTypesResponse Get(this IHelloAllTypesWithResultOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string))
            {
                return operations.GetAsync(name, allTypes, allCollectionTypes).GetAwaiter().GetResult();
            }

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

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='name'>
            /// </param>
            /// <param name='allTypes'>
            /// </param>
            /// <param name='allCollectionTypes'>
            /// </param>
            /// <param name='body'>
            /// </param>
            public static HelloAllTypesResponse Create(this IHelloAllTypesWithResultOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string), HelloAllTypesWithResult body = default(HelloAllTypesWithResult))
            {
                return operations.CreateAsync(name, allTypes, allCollectionTypes, body).GetAwaiter().GetResult();
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='name'>
            /// </param>
            /// <param name='allTypes'>
            /// </param>
            /// <param name='allCollectionTypes'>
            /// </param>
            /// <param name='body'>
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<HelloAllTypesResponse> CreateAsync(this IHelloAllTypesWithResultOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string), HelloAllTypesWithResult body = default(HelloAllTypesWithResult), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateWithHttpMessagesAsync(name, allTypes, allCollectionTypes, body, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='name'>
            /// </param>
            /// <param name='allTypes'>
            /// </param>
            /// <param name='allCollectionTypes'>
            /// </param>
            /// <param name='body'>
            /// </param>
            public static HelloAllTypesResponse Post(this IHelloAllTypesWithResultOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string), HelloAllTypesWithResult body = default(HelloAllTypesWithResult))
            {
                return operations.PostAsync(name, allTypes, allCollectionTypes, body).GetAwaiter().GetResult();
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='name'>
            /// </param>
            /// <param name='allTypes'>
            /// </param>
            /// <param name='allCollectionTypes'>
            /// </param>
            /// <param name='body'>
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<HelloAllTypesResponse> PostAsync(this IHelloAllTypesWithResultOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string), HelloAllTypesWithResult body = default(HelloAllTypesWithResult), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.PostWithHttpMessagesAsync(name, allTypes, allCollectionTypes, body, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='name'>
            /// </param>
            /// <param name='allTypes'>
            /// </param>
            /// <param name='allCollectionTypes'>
            /// </param>
            public static HelloAllTypesResponse Delete(this IHelloAllTypesWithResultOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string))
            {
                return operations.DeleteAsync(name, allTypes, allCollectionTypes).GetAwaiter().GetResult();
            }

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

    }
}
