/// <param name='operations'>
 /// Reference to the TodoList.API.Client.ITodoItems.
 /// </param>
 /// <param name='todoItem'>
 /// Required.
 /// </param>
 public static TodoItem PostTodoItemByTodoitem(this ITodoItems operations, TodoItem todoItem)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ITodoItems)s).PostTodoItemByTodoitemAsync(todoItem);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <param name='operations'>
 /// Reference to the TodoList.API.Client.ITodoItems.
 /// </param>
 /// <param name='id'>
 /// Required.
 /// </param>
 public static TodoItem GetTodoItemById(this ITodoItems operations, string id)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ITodoItems)s).GetTodoItemByIdAsync(id);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <param name='operations'>
 /// Reference to the TodoList.API.Client.ITodoItems.
 /// </param>
 public static IList <TodoItem> GetTodoItems(this ITodoItems operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ITodoItems)s).GetTodoItemsAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the TodoListAPI class.
 /// </summary>
 /// <param name='rootHandler'>
 /// Optional. The http client handler used to handle http transport.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The set of delegating handlers to insert in the http
 /// client pipeline.
 /// </param>
 public TodoListAPI(HttpClientHandler rootHandler, params DelegatingHandler[] handlers)
     : base(rootHandler, handlers)
 {
     this._todoItems = new TodoItems(this);
     this._baseUri   = new Uri("http://localhost:21140");
 }
 /// <summary>
 /// Initializes a new instance of the TodoListAPI class.
 /// </summary>
 public TodoListAPI()
     : base()
 {
     this._todoItems = new TodoItems(this);
     this._baseUri   = new Uri("http://localhost:21140");
 }
        /// <param name='operations'>
        /// Reference to the TodoList.API.Client.ITodoItems.
        /// </param>
        /// <param name='id'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <TodoItem> DeleteTodoItemByIdAsync(this ITodoItems operations, string id, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <TodoList.API.Client.Models.TodoItem> result = await operations.DeleteTodoItemByIdWithOperationResponseAsync(id, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
        /// <param name='operations'>
        /// Reference to the TodoList.API.Client.ITodoItems.
        /// </param>
        /// <param name='id'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <string> CloseItemByIdAsync(this ITodoItems operations, string id, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <string> result = await operations.CloseItemByIdWithOperationResponseAsync(id, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
        /// <param name='operations'>
        /// Reference to the TodoList.API.Client.ITodoItems.
        /// </param>
        /// <param name='todoItem'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <TodoItem> PostTodoItemByTodoitemAsync(this ITodoItems operations, TodoItem todoItem, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <TodoList.API.Client.Models.TodoItem> result = await operations.PostTodoItemByTodoitemWithOperationResponseAsync(todoItem, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
        /// <param name='operations'>
        /// Reference to the TodoList.API.Client.ITodoItems.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <IList <TodoItem> > GetTodoItemsAsync(this ITodoItems operations, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <System.Collections.Generic.IList <TodoList.API.Client.Models.TodoItem> > result = await operations.GetTodoItemsWithOperationResponseAsync(cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }