< Summary

Information
Class: /home/wethinkcode/student_work/csharp/GroupProject/super-cool-group/weshare-qa/GeneratedApiCode/src/Applications.WeShare.Swagger/Api/ExpensesApi.cs
Assembly: Default
File(s): /home/wethinkcode/student_work/csharp/GroupProject/super-cool-group/weshare-qa/GeneratedApiCode/src/Applications.WeShare.Swagger/Api/ExpensesApi.cs
Line coverage
45%
Covered lines: 144
Uncovered lines: 176
Coverable lines: 320
Total lines: 859
Line coverage: 45%
Branch coverage
39%
Covered branches: 30
Total branches: 76
Branch coverage: 39.4%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

/home/wethinkcode/student_work/csharp/GroupProject/super-cool-group/weshare-qa/GeneratedApiCode/src/Applications.WeShare.Swagger/Api/ExpensesApi.cs

#LineLine coverage
 1/*
 2 * WeShare API
 3 *
 4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 5 *
 6 * The version of the OpenAPI document: 1.0
 7 * Generated by: https://github.com/openapitools/openapi-generator.git
 8 */
 9
 10
 11using System;
 12using System.Collections.Generic;
 13using System.Collections.ObjectModel;
 14using System.Linq;
 15using System.Net;
 16using System.Net.Mime;
 17using Applications.WeShare.Swagger.Client;
 18using Applications.WeShare.Swagger.Model;
 19
 20namespace Applications.WeShare.Swagger.Api
 21{
 22
 23    /// <summary>
 24    /// Represents a collection of functions to interact with the API endpoints
 25    /// </summary>
 26    public interface IExpensesApiSync : IApiAccessor
 27    {
 28        #region Synchronous Operations
 29        /// <summary>
 30        /// Create a new expense for a person
 31        /// </summary>
 32        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 33        /// <param name="newExpenseDTO"> (optional)</param>
 34        /// <param name="operationIndex">Index associated with the operation.</param>
 35        /// <returns>ExpenseDTO</returns>
 36        ExpenseDTO CreateExpense(NewExpenseDTO newExpenseDTO = default(NewExpenseDTO), int operationIndex = 0);
 37
 38        /// <summary>
 39        /// Create a new expense for a person
 40        /// </summary>
 41        /// <remarks>
 42        ///
 43        /// </remarks>
 44        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 45        /// <param name="newExpenseDTO"> (optional)</param>
 46        /// <param name="operationIndex">Index associated with the operation.</param>
 47        /// <returns>ApiResponse of ExpenseDTO</returns>
 48        ApiResponse<ExpenseDTO> CreateExpenseWithHttpInfo(NewExpenseDTO newExpenseDTO = default(NewExpenseDTO), int oper
 49        /// <summary>
 50        /// Find all expenses
 51        /// </summary>
 52        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 53        /// <param name="operationIndex">Index associated with the operation.</param>
 54        /// <returns>List&lt;ExpenseDTO&gt;</returns>
 55        List<ExpenseDTO> FindAllExpenses(int operationIndex = 0);
 56
 57        /// <summary>
 58        /// Find all expenses
 59        /// </summary>
 60        /// <remarks>
 61        ///
 62        /// </remarks>
 63        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 64        /// <param name="operationIndex">Index associated with the operation.</param>
 65        /// <returns>ApiResponse of List&lt;ExpenseDTO&gt;</returns>
 66        ApiResponse<List<ExpenseDTO>> FindAllExpensesWithHttpInfo(int operationIndex = 0);
 67        /// <summary>
 68        /// Find an expense by ID
 69        /// </summary>
 70        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 71        /// <param name="expenseId">The expense ID</param>
 72        /// <param name="operationIndex">Index associated with the operation.</param>
 73        /// <returns>ExpenseDTO</returns>
 74        ExpenseDTO FindExpenseById(int expenseId, int operationIndex = 0);
 75
 76        /// <summary>
 77        /// Find an expense by ID
 78        /// </summary>
 79        /// <remarks>
 80        ///
 81        /// </remarks>
 82        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 83        /// <param name="expenseId">The expense ID</param>
 84        /// <param name="operationIndex">Index associated with the operation.</param>
 85        /// <returns>ApiResponse of ExpenseDTO</returns>
 86        ApiResponse<ExpenseDTO> FindExpenseByIdWithHttpInfo(int expenseId, int operationIndex = 0);
 87        /// <summary>
 88        /// Find expenses for a person
 89        /// </summary>
 90        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 91        /// <param name="personId">The ID of the person</param>
 92        /// <param name="operationIndex">Index associated with the operation.</param>
 93        /// <returns>List&lt;ExpenseDTO&gt;</returns>
 94        List<ExpenseDTO> FindExpensesByPerson(int personId, int operationIndex = 0);
 95
 96        /// <summary>
 97        /// Find expenses for a person
 98        /// </summary>
 99        /// <remarks>
 100        ///
 101        /// </remarks>
 102        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 103        /// <param name="personId">The ID of the person</param>
 104        /// <param name="operationIndex">Index associated with the operation.</param>
 105        /// <returns>ApiResponse of List&lt;ExpenseDTO&gt;</returns>
 106        ApiResponse<List<ExpenseDTO>> FindExpensesByPersonWithHttpInfo(int personId, int operationIndex = 0);
 107        #endregion Synchronous Operations
 108    }
 109
 110    /// <summary>
 111    /// Represents a collection of functions to interact with the API endpoints
 112    /// </summary>
 113    public interface IExpensesApiAsync : IApiAccessor
 114    {
 115        #region Asynchronous Operations
 116        /// <summary>
 117        /// Create a new expense for a person
 118        /// </summary>
 119        /// <remarks>
 120        ///
 121        /// </remarks>
 122        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 123        /// <param name="newExpenseDTO"> (optional)</param>
 124        /// <param name="operationIndex">Index associated with the operation.</param>
 125        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 126        /// <returns>Task of ExpenseDTO</returns>
 127        System.Threading.Tasks.Task<ExpenseDTO> CreateExpenseAsync(NewExpenseDTO newExpenseDTO = default(NewExpenseDTO),
 128
 129        /// <summary>
 130        /// Create a new expense for a person
 131        /// </summary>
 132        /// <remarks>
 133        ///
 134        /// </remarks>
 135        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 136        /// <param name="newExpenseDTO"> (optional)</param>
 137        /// <param name="operationIndex">Index associated with the operation.</param>
 138        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 139        /// <returns>Task of ApiResponse (ExpenseDTO)</returns>
 140        System.Threading.Tasks.Task<ApiResponse<ExpenseDTO>> CreateExpenseWithHttpInfoAsync(NewExpenseDTO newExpenseDTO 
 141        /// <summary>
 142        /// Find all expenses
 143        /// </summary>
 144        /// <remarks>
 145        ///
 146        /// </remarks>
 147        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 148        /// <param name="operationIndex">Index associated with the operation.</param>
 149        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 150        /// <returns>Task of List&lt;ExpenseDTO&gt;</returns>
 151        System.Threading.Tasks.Task<List<ExpenseDTO>> FindAllExpensesAsync(int operationIndex = 0, System.Threading.Canc
 152
 153        /// <summary>
 154        /// Find all expenses
 155        /// </summary>
 156        /// <remarks>
 157        ///
 158        /// </remarks>
 159        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 160        /// <param name="operationIndex">Index associated with the operation.</param>
 161        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 162        /// <returns>Task of ApiResponse (List&lt;ExpenseDTO&gt;)</returns>
 163        System.Threading.Tasks.Task<ApiResponse<List<ExpenseDTO>>> FindAllExpensesWithHttpInfoAsync(int operationIndex =
 164        /// <summary>
 165        /// Find an expense by ID
 166        /// </summary>
 167        /// <remarks>
 168        ///
 169        /// </remarks>
 170        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 171        /// <param name="expenseId">The expense ID</param>
 172        /// <param name="operationIndex">Index associated with the operation.</param>
 173        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 174        /// <returns>Task of ExpenseDTO</returns>
 175        System.Threading.Tasks.Task<ExpenseDTO> FindExpenseByIdAsync(int expenseId, int operationIndex = 0, System.Threa
 176
 177        /// <summary>
 178        /// Find an expense by ID
 179        /// </summary>
 180        /// <remarks>
 181        ///
 182        /// </remarks>
 183        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 184        /// <param name="expenseId">The expense ID</param>
 185        /// <param name="operationIndex">Index associated with the operation.</param>
 186        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 187        /// <returns>Task of ApiResponse (ExpenseDTO)</returns>
 188        System.Threading.Tasks.Task<ApiResponse<ExpenseDTO>> FindExpenseByIdWithHttpInfoAsync(int expenseId, int operati
 189        /// <summary>
 190        /// Find expenses for a person
 191        /// </summary>
 192        /// <remarks>
 193        ///
 194        /// </remarks>
 195        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 196        /// <param name="personId">The ID of the person</param>
 197        /// <param name="operationIndex">Index associated with the operation.</param>
 198        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 199        /// <returns>Task of List&lt;ExpenseDTO&gt;</returns>
 200        System.Threading.Tasks.Task<List<ExpenseDTO>> FindExpensesByPersonAsync(int personId, int operationIndex = 0, Sy
 201
 202        /// <summary>
 203        /// Find expenses for a person
 204        /// </summary>
 205        /// <remarks>
 206        ///
 207        /// </remarks>
 208        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 209        /// <param name="personId">The ID of the person</param>
 210        /// <param name="operationIndex">Index associated with the operation.</param>
 211        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 212        /// <returns>Task of ApiResponse (List&lt;ExpenseDTO&gt;)</returns>
 213        System.Threading.Tasks.Task<ApiResponse<List<ExpenseDTO>>> FindExpensesByPersonWithHttpInfoAsync(int personId, i
 214        #endregion Asynchronous Operations
 215    }
 216
 217    /// <summary>
 218    /// Represents a collection of functions to interact with the API endpoints
 219    /// </summary>
 220    public interface IExpensesApi : IExpensesApiSync, IExpensesApiAsync
 221    {
 222
 223    }
 224
 225    /// <summary>
 226    /// Represents a collection of functions to interact with the API endpoints
 227    /// </summary>
 228    public partial class ExpensesApi : IExpensesApi
 229    {
 2230        private Applications.WeShare.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
 231
 232        /// <summary>
 233        /// Initializes a new instance of the <see cref="ExpensesApi"/> class.
 234        /// </summary>
 235        /// <returns></returns>
 0236        public ExpensesApi() : this((string)null)
 0237        {
 0238        }
 239
 240        /// <summary>
 241        /// Initializes a new instance of the <see cref="ExpensesApi"/> class.
 242        /// </summary>
 243        /// <returns></returns>
 2244        public ExpensesApi(string basePath)
 2245        {
 2246            this.Configuration = Applications.WeShare.Swagger.Client.Configuration.MergeConfigurations(
 2247                Applications.WeShare.Swagger.Client.GlobalConfiguration.Instance,
 2248                new Applications.WeShare.Swagger.Client.Configuration { BasePath = basePath }
 2249            );
 2250            this.Client = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath);
 2251            this.AsynchronousClient = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath);
 2252            this.ExceptionFactory = Applications.WeShare.Swagger.Client.Configuration.DefaultExceptionFactory;
 2253        }
 254
 255        /// <summary>
 256        /// Initializes a new instance of the <see cref="ExpensesApi"/> class
 257        /// using Configuration object
 258        /// </summary>
 259        /// <param name="configuration">An instance of Configuration</param>
 260        /// <returns></returns>
 0261        public ExpensesApi(Applications.WeShare.Swagger.Client.Configuration configuration)
 0262        {
 0263            if (configuration == null) throw new ArgumentNullException("configuration");
 264
 0265            this.Configuration = Applications.WeShare.Swagger.Client.Configuration.MergeConfigurations(
 0266                Applications.WeShare.Swagger.Client.GlobalConfiguration.Instance,
 0267                configuration
 0268            );
 0269            this.Client = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath);
 0270            this.AsynchronousClient = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath);
 0271            ExceptionFactory = Applications.WeShare.Swagger.Client.Configuration.DefaultExceptionFactory;
 0272        }
 273
 274        /// <summary>
 275        /// Initializes a new instance of the <see cref="ExpensesApi"/> class
 276        /// using a Configuration object and client instance.
 277        /// </summary>
 278        /// <param name="client">The client interface for synchronous API access.</param>
 279        /// <param name="asyncClient">The client interface for asynchronous API access.</param>
 280        /// <param name="configuration">The configuration object.</param>
 0281        public ExpensesApi(Applications.WeShare.Swagger.Client.ISynchronousClient client, Applications.WeShare.Swagger.C
 0282        {
 0283            if (client == null) throw new ArgumentNullException("client");
 0284            if (asyncClient == null) throw new ArgumentNullException("asyncClient");
 0285            if (configuration == null) throw new ArgumentNullException("configuration");
 286
 0287            this.Client = client;
 0288            this.AsynchronousClient = asyncClient;
 0289            this.Configuration = configuration;
 0290            this.ExceptionFactory = Applications.WeShare.Swagger.Client.Configuration.DefaultExceptionFactory;
 0291        }
 292
 293        /// <summary>
 294        /// The client for accessing this underlying API asynchronously.
 295        /// </summary>
 2296        public Applications.WeShare.Swagger.Client.IAsynchronousClient AsynchronousClient { get; set; }
 297
 298        /// <summary>
 299        /// The client for accessing this underlying API synchronously.
 300        /// </summary>
 11301        public Applications.WeShare.Swagger.Client.ISynchronousClient Client { get; set; }
 302
 303        /// <summary>
 304        /// Gets the base path of the API client.
 305        /// </summary>
 306        /// <value>The base path</value>
 307        public string GetBasePath()
 0308        {
 0309            return this.Configuration.BasePath;
 0310        }
 311
 312        /// <summary>
 313        /// Gets or sets the configuration object
 314        /// </summary>
 315        /// <value>An instance of the Configuration</value>
 15316        public Applications.WeShare.Swagger.Client.IReadableConfiguration Configuration { get; set; }
 317
 318        /// <summary>
 319        /// Provides a factory method hook for the creation of exceptions.
 320        /// </summary>
 321        public Applications.WeShare.Swagger.Client.ExceptionFactory ExceptionFactory
 322        {
 323            get
 18324            {
 18325                if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
 0326                {
 0327                    throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
 328                }
 18329                return _exceptionFactory;
 18330            }
 6331            set { _exceptionFactory = value; }
 332        }
 333
 334        /// <summary>
 335        /// Create a new expense for a person
 336        /// </summary>
 337        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 338        /// <param name="newExpenseDTO"> (optional)</param>
 339        /// <param name="operationIndex">Index associated with the operation.</param>
 340        /// <returns>ExpenseDTO</returns>
 341        public ExpenseDTO CreateExpense(NewExpenseDTO newExpenseDTO = default(NewExpenseDTO), int operationIndex = 0)
 2342        {
 2343            Applications.WeShare.Swagger.Client.ApiResponse<ExpenseDTO> localVarResponse = CreateExpenseWithHttpInfo(new
 1344            return localVarResponse.Data;
 1345        }
 346
 347        /// <summary>
 348        /// Create a new expense for a person
 349        /// </summary>
 350        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 351        /// <param name="newExpenseDTO"> (optional)</param>
 352        /// <param name="operationIndex">Index associated with the operation.</param>
 353        /// <returns>ApiResponse of ExpenseDTO</returns>
 354        public Applications.WeShare.Swagger.Client.ApiResponse<ExpenseDTO> CreateExpenseWithHttpInfo(NewExpenseDTO newEx
 2355        {
 2356            Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger
 357
 2358            string[] _contentTypes = new string[] {
 2359                "application/json"
 2360            };
 361
 362            // to determine the Accept header
 2363            string[] _accepts = new string[] {
 2364                "application/json"
 2365            };
 366
 2367            var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy
 2368            if (localVarContentType != null)
 2369            {
 2370                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
 2371            }
 372
 2373            var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts);
 2374            if (localVarAccept != null)
 2375            {
 2376                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
 2377            }
 378
 2379            localVarRequestOptions.Data = newExpenseDTO;
 380
 2381            localVarRequestOptions.Operation = "ExpensesApi.CreateExpense";
 2382            localVarRequestOptions.OperationIndex = operationIndex;
 383
 384
 385            // make the HTTP request
 2386            var localVarResponse = this.Client.Post<ExpenseDTO>("/api/expenses", localVarRequestOptions, this.Configurat
 2387            if (this.ExceptionFactory != null)
 2388            {
 2389                Exception _exception = this.ExceptionFactory("CreateExpense", localVarResponse);
 2390                if (_exception != null)
 1391                {
 1392                    throw _exception;
 393                }
 1394            }
 395
 1396            return localVarResponse;
 1397        }
 398
 399        /// <summary>
 400        /// Create a new expense for a person
 401        /// </summary>
 402        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 403        /// <param name="newExpenseDTO"> (optional)</param>
 404        /// <param name="operationIndex">Index associated with the operation.</param>
 405        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 406        /// <returns>Task of ExpenseDTO</returns>
 407        public async System.Threading.Tasks.Task<ExpenseDTO> CreateExpenseAsync(NewExpenseDTO newExpenseDTO = default(Ne
 0408        {
 0409            Applications.WeShare.Swagger.Client.ApiResponse<ExpenseDTO> localVarResponse = await CreateExpenseWithHttpIn
 0410            return localVarResponse.Data;
 0411        }
 412
 413        /// <summary>
 414        /// Create a new expense for a person
 415        /// </summary>
 416        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 417        /// <param name="newExpenseDTO"> (optional)</param>
 418        /// <param name="operationIndex">Index associated with the operation.</param>
 419        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 420        /// <returns>Task of ApiResponse (ExpenseDTO)</returns>
 421        public async System.Threading.Tasks.Task<Applications.WeShare.Swagger.Client.ApiResponse<ExpenseDTO>> CreateExpe
 0422        {
 423
 0424            Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger
 425
 0426            string[] _contentTypes = new string[] {
 0427                "application/json"
 0428            };
 429
 430            // to determine the Accept header
 0431            string[] _accepts = new string[] {
 0432                "application/json"
 0433            };
 434
 0435            var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy
 0436            if (localVarContentType != null)
 0437            {
 0438                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
 0439            }
 440
 0441            var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts);
 0442            if (localVarAccept != null)
 0443            {
 0444                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
 0445            }
 446
 0447            localVarRequestOptions.Data = newExpenseDTO;
 448
 0449            localVarRequestOptions.Operation = "ExpensesApi.CreateExpense";
 0450            localVarRequestOptions.OperationIndex = operationIndex;
 451
 452
 453            // make the HTTP request
 0454            var localVarResponse = await this.AsynchronousClient.PostAsync<ExpenseDTO>("/api/expenses", localVarRequestO
 455
 0456            if (this.ExceptionFactory != null)
 0457            {
 0458                Exception _exception = this.ExceptionFactory("CreateExpense", localVarResponse);
 0459                if (_exception != null)
 0460                {
 0461                    throw _exception;
 462                }
 0463            }
 464
 0465            return localVarResponse;
 0466        }
 467
 468        /// <summary>
 469        /// Find all expenses
 470        /// </summary>
 471        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 472        /// <param name="operationIndex">Index associated with the operation.</param>
 473        /// <returns>List&lt;ExpenseDTO&gt;</returns>
 474        public List<ExpenseDTO> FindAllExpenses(int operationIndex = 0)
 1475        {
 1476            Applications.WeShare.Swagger.Client.ApiResponse<List<ExpenseDTO>> localVarResponse = FindAllExpensesWithHttp
 1477            return localVarResponse.Data;
 1478        }
 479
 480        /// <summary>
 481        /// Find all expenses
 482        /// </summary>
 483        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 484        /// <param name="operationIndex">Index associated with the operation.</param>
 485        /// <returns>ApiResponse of List&lt;ExpenseDTO&gt;</returns>
 486        public Applications.WeShare.Swagger.Client.ApiResponse<List<ExpenseDTO>> FindAllExpensesWithHttpInfo(int operati
 1487        {
 1488            Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger
 489
 1490            string[] _contentTypes = new string[] {
 1491            };
 492
 493            // to determine the Accept header
 1494            string[] _accepts = new string[] {
 1495                "application/json"
 1496            };
 497
 1498            var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy
 1499            if (localVarContentType != null)
 0500            {
 0501                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
 0502            }
 503
 1504            var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts);
 1505            if (localVarAccept != null)
 1506            {
 1507                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
 1508            }
 509
 510
 1511            localVarRequestOptions.Operation = "ExpensesApi.FindAllExpenses";
 1512            localVarRequestOptions.OperationIndex = operationIndex;
 513
 514
 515            // make the HTTP request
 1516            var localVarResponse = this.Client.Get<List<ExpenseDTO>>("/api/expenses", localVarRequestOptions, this.Confi
 1517            if (this.ExceptionFactory != null)
 1518            {
 1519                Exception _exception = this.ExceptionFactory("FindAllExpenses", localVarResponse);
 1520                if (_exception != null)
 0521                {
 0522                    throw _exception;
 523                }
 1524            }
 525
 1526            return localVarResponse;
 1527        }
 528
 529        /// <summary>
 530        /// Find all expenses
 531        /// </summary>
 532        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 533        /// <param name="operationIndex">Index associated with the operation.</param>
 534        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 535        /// <returns>Task of List&lt;ExpenseDTO&gt;</returns>
 536        public async System.Threading.Tasks.Task<List<ExpenseDTO>> FindAllExpensesAsync(int operationIndex = 0, System.T
 0537        {
 0538            Applications.WeShare.Swagger.Client.ApiResponse<List<ExpenseDTO>> localVarResponse = await FindAllExpensesWi
 0539            return localVarResponse.Data;
 0540        }
 541
 542        /// <summary>
 543        /// Find all expenses
 544        /// </summary>
 545        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 546        /// <param name="operationIndex">Index associated with the operation.</param>
 547        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 548        /// <returns>Task of ApiResponse (List&lt;ExpenseDTO&gt;)</returns>
 549        public async System.Threading.Tasks.Task<Applications.WeShare.Swagger.Client.ApiResponse<List<ExpenseDTO>>> Find
 0550        {
 551
 0552            Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger
 553
 0554            string[] _contentTypes = new string[] {
 0555            };
 556
 557            // to determine the Accept header
 0558            string[] _accepts = new string[] {
 0559                "application/json"
 0560            };
 561
 0562            var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy
 0563            if (localVarContentType != null)
 0564            {
 0565                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
 0566            }
 567
 0568            var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts);
 0569            if (localVarAccept != null)
 0570            {
 0571                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
 0572            }
 573
 574
 0575            localVarRequestOptions.Operation = "ExpensesApi.FindAllExpenses";
 0576            localVarRequestOptions.OperationIndex = operationIndex;
 577
 578
 579            // make the HTTP request
 0580            var localVarResponse = await this.AsynchronousClient.GetAsync<List<ExpenseDTO>>("/api/expenses", localVarReq
 581
 0582            if (this.ExceptionFactory != null)
 0583            {
 0584                Exception _exception = this.ExceptionFactory("FindAllExpenses", localVarResponse);
 0585                if (_exception != null)
 0586                {
 0587                    throw _exception;
 588                }
 0589            }
 590
 0591            return localVarResponse;
 0592        }
 593
 594        /// <summary>
 595        /// Find an expense by ID
 596        /// </summary>
 597        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 598        /// <param name="expenseId">The expense ID</param>
 599        /// <param name="operationIndex">Index associated with the operation.</param>
 600        /// <returns>ExpenseDTO</returns>
 601        public ExpenseDTO FindExpenseById(int expenseId, int operationIndex = 0)
 3602        {
 3603            Applications.WeShare.Swagger.Client.ApiResponse<ExpenseDTO> localVarResponse = FindExpenseByIdWithHttpInfo(e
 1604            return localVarResponse.Data;
 1605        }
 606
 607        /// <summary>
 608        /// Find an expense by ID
 609        /// </summary>
 610        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 611        /// <param name="expenseId">The expense ID</param>
 612        /// <param name="operationIndex">Index associated with the operation.</param>
 613        /// <returns>ApiResponse of ExpenseDTO</returns>
 614        public Applications.WeShare.Swagger.Client.ApiResponse<ExpenseDTO> FindExpenseByIdWithHttpInfo(int expenseId, in
 3615        {
 3616            Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger
 617
 3618            string[] _contentTypes = new string[] {
 3619            };
 620
 621            // to determine the Accept header
 3622            string[] _accepts = new string[] {
 3623                "application/json"
 3624            };
 625
 3626            var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy
 3627            if (localVarContentType != null)
 0628            {
 0629                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
 0630            }
 631
 3632            var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts);
 3633            if (localVarAccept != null)
 3634            {
 3635                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
 3636            }
 637
 3638            localVarRequestOptions.PathParameters.Add("expenseId", Applications.WeShare.Swagger.Client.ClientUtils.Param
 639
 3640            localVarRequestOptions.Operation = "ExpensesApi.FindExpenseById";
 3641            localVarRequestOptions.OperationIndex = operationIndex;
 642
 643
 644            // make the HTTP request
 3645            var localVarResponse = this.Client.Get<ExpenseDTO>("/api/expenses/{expenseId}", localVarRequestOptions, this
 3646            if (this.ExceptionFactory != null)
 3647            {
 3648                Exception _exception = this.ExceptionFactory("FindExpenseById", localVarResponse);
 3649                if (_exception != null)
 2650                {
 2651                    throw _exception;
 652                }
 1653            }
 654
 1655            return localVarResponse;
 1656        }
 657
 658        /// <summary>
 659        /// Find an expense by ID
 660        /// </summary>
 661        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 662        /// <param name="expenseId">The expense ID</param>
 663        /// <param name="operationIndex">Index associated with the operation.</param>
 664        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 665        /// <returns>Task of ExpenseDTO</returns>
 666        public async System.Threading.Tasks.Task<ExpenseDTO> FindExpenseByIdAsync(int expenseId, int operationIndex = 0,
 0667        {
 0668            Applications.WeShare.Swagger.Client.ApiResponse<ExpenseDTO> localVarResponse = await FindExpenseByIdWithHttp
 0669            return localVarResponse.Data;
 0670        }
 671
 672        /// <summary>
 673        /// Find an expense by ID
 674        /// </summary>
 675        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 676        /// <param name="expenseId">The expense ID</param>
 677        /// <param name="operationIndex">Index associated with the operation.</param>
 678        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 679        /// <returns>Task of ApiResponse (ExpenseDTO)</returns>
 680        public async System.Threading.Tasks.Task<Applications.WeShare.Swagger.Client.ApiResponse<ExpenseDTO>> FindExpens
 0681        {
 682
 0683            Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger
 684
 0685            string[] _contentTypes = new string[] {
 0686            };
 687
 688            // to determine the Accept header
 0689            string[] _accepts = new string[] {
 0690                "application/json"
 0691            };
 692
 0693            var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy
 0694            if (localVarContentType != null)
 0695            {
 0696                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
 0697            }
 698
 0699            var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts);
 0700            if (localVarAccept != null)
 0701            {
 0702                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
 0703            }
 704
 0705            localVarRequestOptions.PathParameters.Add("expenseId", Applications.WeShare.Swagger.Client.ClientUtils.Param
 706
 0707            localVarRequestOptions.Operation = "ExpensesApi.FindExpenseById";
 0708            localVarRequestOptions.OperationIndex = operationIndex;
 709
 710
 711            // make the HTTP request
 0712            var localVarResponse = await this.AsynchronousClient.GetAsync<ExpenseDTO>("/api/expenses/{expenseId}", local
 713
 0714            if (this.ExceptionFactory != null)
 0715            {
 0716                Exception _exception = this.ExceptionFactory("FindExpenseById", localVarResponse);
 0717                if (_exception != null)
 0718                {
 0719                    throw _exception;
 720                }
 0721            }
 722
 0723            return localVarResponse;
 0724        }
 725
 726        /// <summary>
 727        /// Find expenses for a person
 728        /// </summary>
 729        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 730        /// <param name="personId">The ID of the person</param>
 731        /// <param name="operationIndex">Index associated with the operation.</param>
 732        /// <returns>List&lt;ExpenseDTO&gt;</returns>
 733        public List<ExpenseDTO> FindExpensesByPerson(int personId, int operationIndex = 0)
 3734        {
 3735            Applications.WeShare.Swagger.Client.ApiResponse<List<ExpenseDTO>> localVarResponse = FindExpensesByPersonWit
 1736            return localVarResponse.Data;
 1737        }
 738
 739        /// <summary>
 740        /// Find expenses for a person
 741        /// </summary>
 742        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 743        /// <param name="personId">The ID of the person</param>
 744        /// <param name="operationIndex">Index associated with the operation.</param>
 745        /// <returns>ApiResponse of List&lt;ExpenseDTO&gt;</returns>
 746        public Applications.WeShare.Swagger.Client.ApiResponse<List<ExpenseDTO>> FindExpensesByPersonWithHttpInfo(int pe
 3747        {
 3748            Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger
 749
 3750            string[] _contentTypes = new string[] {
 3751            };
 752
 753            // to determine the Accept header
 3754            string[] _accepts = new string[] {
 3755                "application/json"
 3756            };
 757
 3758            var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy
 3759            if (localVarContentType != null)
 0760            {
 0761                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
 0762            }
 763
 3764            var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts);
 3765            if (localVarAccept != null)
 3766            {
 3767                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
 3768            }
 769
 3770            localVarRequestOptions.PathParameters.Add("personId", Applications.WeShare.Swagger.Client.ClientUtils.Parame
 771
 3772            localVarRequestOptions.Operation = "ExpensesApi.FindExpensesByPerson";
 3773            localVarRequestOptions.OperationIndex = operationIndex;
 774
 775
 776            // make the HTTP request
 3777            var localVarResponse = this.Client.Get<List<ExpenseDTO>>("/api/expenses/person/{personId}", localVarRequestO
 3778            if (this.ExceptionFactory != null)
 3779            {
 3780                Exception _exception = this.ExceptionFactory("FindExpensesByPerson", localVarResponse);
 3781                if (_exception != null)
 2782                {
 2783                    throw _exception;
 784                }
 1785            }
 786
 1787            return localVarResponse;
 1788        }
 789
 790        /// <summary>
 791        /// Find expenses for a person
 792        /// </summary>
 793        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 794        /// <param name="personId">The ID of the person</param>
 795        /// <param name="operationIndex">Index associated with the operation.</param>
 796        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 797        /// <returns>Task of List&lt;ExpenseDTO&gt;</returns>
 798        public async System.Threading.Tasks.Task<List<ExpenseDTO>> FindExpensesByPersonAsync(int personId, int operation
 0799        {
 0800            Applications.WeShare.Swagger.Client.ApiResponse<List<ExpenseDTO>> localVarResponse = await FindExpensesByPer
 0801            return localVarResponse.Data;
 0802        }
 803
 804        /// <summary>
 805        /// Find expenses for a person
 806        /// </summary>
 807        /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep
 808        /// <param name="personId">The ID of the person</param>
 809        /// <param name="operationIndex">Index associated with the operation.</param>
 810        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
 811        /// <returns>Task of ApiResponse (List&lt;ExpenseDTO&gt;)</returns>
 812        public async System.Threading.Tasks.Task<Applications.WeShare.Swagger.Client.ApiResponse<List<ExpenseDTO>>> Find
 0813        {
 814
 0815            Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger
 816
 0817            string[] _contentTypes = new string[] {
 0818            };
 819
 820            // to determine the Accept header
 0821            string[] _accepts = new string[] {
 0822                "application/json"
 0823            };
 824
 0825            var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy
 0826            if (localVarContentType != null)
 0827            {
 0828                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
 0829            }
 830
 0831            var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts);
 0832            if (localVarAccept != null)
 0833            {
 0834                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
 0835            }
 836
 0837            localVarRequestOptions.PathParameters.Add("personId", Applications.WeShare.Swagger.Client.ClientUtils.Parame
 838
 0839            localVarRequestOptions.Operation = "ExpensesApi.FindExpensesByPerson";
 0840            localVarRequestOptions.OperationIndex = operationIndex;
 841
 842
 843            // make the HTTP request
 0844            var localVarResponse = await this.AsynchronousClient.GetAsync<List<ExpenseDTO>>("/api/expenses/person/{perso
 845
 0846            if (this.ExceptionFactory != null)
 0847            {
 0848                Exception _exception = this.ExceptionFactory("FindExpensesByPerson", localVarResponse);
 0849                if (_exception != null)
 0850                {
 0851                    throw _exception;
 852                }
 0853            }
 854
 0855            return localVarResponse;
 0856        }
 857
 858    }
 859}

Methods/Properties

System.Void Applications.WeShare.Swagger.Api.ExpensesApi::.ctor(System.String)
System.Void Applications.WeShare.Swagger.Api.ExpensesApi::.ctor()
System.Void Applications.WeShare.Swagger.Api.ExpensesApi::.ctor(Applications.WeShare.Swagger.Client.Configuration)
System.Void Applications.WeShare.Swagger.Api.ExpensesApi::.ctor(Applications.WeShare.Swagger.Client.ISynchronousClient,Applications.WeShare.Swagger.Client.IAsynchronousClient,Applications.WeShare.Swagger.Client.IReadableConfiguration)
Applications.WeShare.Swagger.Client.IAsynchronousClient Applications.WeShare.Swagger.Api.ExpensesApi::get_AsynchronousClient()
Applications.WeShare.Swagger.Client.ISynchronousClient Applications.WeShare.Swagger.Api.ExpensesApi::get_Client()
System.String Applications.WeShare.Swagger.Api.ExpensesApi::GetBasePath()
Applications.WeShare.Swagger.Client.IReadableConfiguration Applications.WeShare.Swagger.Api.ExpensesApi::get_Configuration()
Applications.WeShare.Swagger.Client.ExceptionFactory Applications.WeShare.Swagger.Api.ExpensesApi::get_ExceptionFactory()
System.Void Applications.WeShare.Swagger.Api.ExpensesApi::set_ExceptionFactory(Applications.WeShare.Swagger.Client.ExceptionFactory)
Applications.WeShare.Swagger.Model.ExpenseDTO Applications.WeShare.Swagger.Api.ExpensesApi::CreateExpense(Applications.WeShare.Swagger.Model.NewExpenseDTO,System.Int32)
Applications.WeShare.Swagger.Client.ApiResponse`1<Applications.WeShare.Swagger.Model.ExpenseDTO> Applications.WeShare.Swagger.Api.ExpensesApi::CreateExpenseWithHttpInfo(Applications.WeShare.Swagger.Model.NewExpenseDTO,System.Int32)
System.Void Applications.WeShare.Swagger.Api.ExpensesApi/<CreateExpenseAsync>d__23::MoveNext()
System.Void Applications.WeShare.Swagger.Api.ExpensesApi/<CreateExpenseWithHttpInfoAsync>d__24::MoveNext()
System.Collections.Generic.List`1<Applications.WeShare.Swagger.Model.ExpenseDTO> Applications.WeShare.Swagger.Api.ExpensesApi::FindAllExpenses(System.Int32)
Applications.WeShare.Swagger.Client.ApiResponse`1<System.Collections.Generic.List`1<Applications.WeShare.Swagger.Model.ExpenseDTO>> Applications.WeShare.Swagger.Api.ExpensesApi::FindAllExpensesWithHttpInfo(System.Int32)
System.Void Applications.WeShare.Swagger.Api.ExpensesApi/<FindAllExpensesAsync>d__27::MoveNext()
System.Void Applications.WeShare.Swagger.Api.ExpensesApi/<FindAllExpensesWithHttpInfoAsync>d__28::MoveNext()
Applications.WeShare.Swagger.Model.ExpenseDTO Applications.WeShare.Swagger.Api.ExpensesApi::FindExpenseById(System.Int32,System.Int32)
Applications.WeShare.Swagger.Client.ApiResponse`1<Applications.WeShare.Swagger.Model.ExpenseDTO> Applications.WeShare.Swagger.Api.ExpensesApi::FindExpenseByIdWithHttpInfo(System.Int32,System.Int32)
System.Void Applications.WeShare.Swagger.Api.ExpensesApi/<FindExpenseByIdAsync>d__31::MoveNext()
System.Void Applications.WeShare.Swagger.Api.ExpensesApi/<FindExpenseByIdWithHttpInfoAsync>d__32::MoveNext()
System.Collections.Generic.List`1<Applications.WeShare.Swagger.Model.ExpenseDTO> Applications.WeShare.Swagger.Api.ExpensesApi::FindExpensesByPerson(System.Int32,System.Int32)
Applications.WeShare.Swagger.Client.ApiResponse`1<System.Collections.Generic.List`1<Applications.WeShare.Swagger.Model.ExpenseDTO>> Applications.WeShare.Swagger.Api.ExpensesApi::FindExpensesByPersonWithHttpInfo(System.Int32,System.Int32)
System.Void Applications.WeShare.Swagger.Api.ExpensesApi/<FindExpensesByPersonAsync>d__35::MoveNext()
System.Void Applications.WeShare.Swagger.Api.ExpensesApi/<FindExpensesByPersonWithHttpInfoAsync>d__36::MoveNext()