// 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 HelloAllTypesOperations.
    /// </summary>
    public static partial class HelloAllTypesOperationsExtensions
    {
            /// <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 object Get(this IHelloAllTypesOperations 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<object> GetAsync(this IHelloAllTypesOperations 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 object Create(this IHelloAllTypesOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string), HelloAllTypes body = default(HelloAllTypes))
            {
                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<object> CreateAsync(this IHelloAllTypesOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string), HelloAllTypes body = default(HelloAllTypes), 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 object Post(this IHelloAllTypesOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string), HelloAllTypes body = default(HelloAllTypes))
            {
                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<object> PostAsync(this IHelloAllTypesOperations operations, string name = default(string), string allTypes = default(string), string allCollectionTypes = default(string), HelloAllTypes body = default(HelloAllTypes), 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 object Delete(this IHelloAllTypesOperations 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<object> DeleteAsync(this IHelloAllTypesOperations 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;
                }
            }

    }
}
