// 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 HelloDateTimeOperations.
    /// </summary>
    public static partial class HelloDateTimeOperationsExtensions
    {
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='dateTime'>
            /// </param>
            public static HelloDateTime Get(this IHelloDateTimeOperations operations, System.DateTime dateTime = default(System.DateTime))
            {
                return operations.GetAsync(dateTime).GetAwaiter().GetResult();
            }

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

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='dateTime'>
            /// </param>
            /// <param name='body'>
            /// </param>
            public static HelloDateTime Create(this IHelloDateTimeOperations operations, System.DateTime dateTime = default(System.DateTime), HelloDateTime body = default(HelloDateTime))
            {
                return operations.CreateAsync(dateTime, body).GetAwaiter().GetResult();
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='dateTime'>
            /// </param>
            /// <param name='body'>
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<HelloDateTime> CreateAsync(this IHelloDateTimeOperations operations, System.DateTime dateTime = default(System.DateTime), HelloDateTime body = default(HelloDateTime), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateWithHttpMessagesAsync(dateTime, body, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='dateTime'>
            /// </param>
            /// <param name='body'>
            /// </param>
            public static HelloDateTime Post(this IHelloDateTimeOperations operations, System.DateTime dateTime = default(System.DateTime), HelloDateTime body = default(HelloDateTime))
            {
                return operations.PostAsync(dateTime, body).GetAwaiter().GetResult();
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='dateTime'>
            /// </param>
            /// <param name='body'>
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<HelloDateTime> PostAsync(this IHelloDateTimeOperations operations, System.DateTime dateTime = default(System.DateTime), HelloDateTime body = default(HelloDateTime), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.PostWithHttpMessagesAsync(dateTime, body, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='dateTime'>
            /// </param>
            public static HelloDateTime Delete(this IHelloDateTimeOperations operations, System.DateTime dateTime = default(System.DateTime))
            {
                return operations.DeleteAsync(dateTime).GetAwaiter().GetResult();
            }

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

    }
}
