/// Code generated by Microsoft (R) AutoRest Code Generator 0.10.0.0
/// Changes may cause incorrect behavior and will be lost if the code is
/// regenerated.
namespace Sample01
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.Rest;

    public static partial class Client01Extensions
    {
            /// <summary>
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method
            /// </param>
            public static string GetGreeting(this IClient01 operations)
            {
                return Task.Factory.StartNew(s => ((IClient01)s).GetGreetingAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
            }

            /// <summary>
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method
            /// </param>
            /// <param name='cancellationToken'>
            /// Cancellation token.
            /// </param>
            public static async Task<string> GetGreetingAsync( this IClient01 operations, CancellationToken cancellationToken = default(CancellationToken))
            {
                HttpOperationResponse<string> result = await operations.GetGreetingWithOperationResponseAsync(cancellationToken).ConfigureAwait(false);
                return result.Body;
            }

    }
}
