| | 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 | |
|
| | 11 | | using System; |
| | 12 | | using System.Collections.Generic; |
| | 13 | | using System.Collections.ObjectModel; |
| | 14 | | using System.Linq; |
| | 15 | | using System.Net; |
| | 16 | | using System.Net.Mime; |
| | 17 | | using Applications.WeShare.Swagger.Client; |
| | 18 | | using Applications.WeShare.Swagger.Model; |
| | 19 | |
|
| | 20 | | namespace 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 IPaymentsApiSync : IApiAccessor |
| | 27 | | { |
| | 28 | | #region Synchronous Operations |
| | 29 | | /// <summary> |
| | 30 | | /// Find all payments made by a person |
| | 31 | | /// </summary> |
| | 32 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 33 | | /// <param name="personId">The ID of the person</param> |
| | 34 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 35 | | /// <returns>List<PaymentDTO></returns> |
| | 36 | | List<PaymentDTO> FindPaymentsMadeByPerson(int personId, int operationIndex = 0); |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Find all payments made by 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="personId">The ID of the person</param> |
| | 46 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 47 | | /// <returns>ApiResponse of List<PaymentDTO></returns> |
| | 48 | | ApiResponse<List<PaymentDTO>> FindPaymentsMadeByPersonWithHttpInfo(int personId, int operationIndex = 0); |
| | 49 | | /// <summary> |
| | 50 | | /// Pay a payment request |
| | 51 | | /// </summary> |
| | 52 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 53 | | /// <param name="newPaymentDTO"> (optional)</param> |
| | 54 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 55 | | /// <returns>PaymentDTO</returns> |
| | 56 | | PaymentDTO PayPaymentRequest(NewPaymentDTO newPaymentDTO = default(NewPaymentDTO), int operationIndex = 0); |
| | 57 | |
|
| | 58 | | /// <summary> |
| | 59 | | /// Pay a payment request |
| | 60 | | /// </summary> |
| | 61 | | /// <remarks> |
| | 62 | | /// |
| | 63 | | /// </remarks> |
| | 64 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 65 | | /// <param name="newPaymentDTO"> (optional)</param> |
| | 66 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 67 | | /// <returns>ApiResponse of PaymentDTO</returns> |
| | 68 | | ApiResponse<PaymentDTO> PayPaymentRequestWithHttpInfo(NewPaymentDTO newPaymentDTO = default(NewPaymentDTO), int |
| | 69 | | #endregion Synchronous Operations |
| | 70 | | } |
| | 71 | |
|
| | 72 | | /// <summary> |
| | 73 | | /// Represents a collection of functions to interact with the API endpoints |
| | 74 | | /// </summary> |
| | 75 | | public interface IPaymentsApiAsync : IApiAccessor |
| | 76 | | { |
| | 77 | | #region Asynchronous Operations |
| | 78 | | /// <summary> |
| | 79 | | /// Find all payments made by a person |
| | 80 | | /// </summary> |
| | 81 | | /// <remarks> |
| | 82 | | /// |
| | 83 | | /// </remarks> |
| | 84 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 85 | | /// <param name="personId">The ID of the person</param> |
| | 86 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 87 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 88 | | /// <returns>Task of List<PaymentDTO></returns> |
| | 89 | | System.Threading.Tasks.Task<List<PaymentDTO>> FindPaymentsMadeByPersonAsync(int personId, int operationIndex = 0 |
| | 90 | |
|
| | 91 | | /// <summary> |
| | 92 | | /// Find all payments made by a person |
| | 93 | | /// </summary> |
| | 94 | | /// <remarks> |
| | 95 | | /// |
| | 96 | | /// </remarks> |
| | 97 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 98 | | /// <param name="personId">The ID of the person</param> |
| | 99 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 100 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 101 | | /// <returns>Task of ApiResponse (List<PaymentDTO>)</returns> |
| | 102 | | System.Threading.Tasks.Task<ApiResponse<List<PaymentDTO>>> FindPaymentsMadeByPersonWithHttpInfoAsync(int personI |
| | 103 | | /// <summary> |
| | 104 | | /// Pay a payment request |
| | 105 | | /// </summary> |
| | 106 | | /// <remarks> |
| | 107 | | /// |
| | 108 | | /// </remarks> |
| | 109 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 110 | | /// <param name="newPaymentDTO"> (optional)</param> |
| | 111 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 112 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 113 | | /// <returns>Task of PaymentDTO</returns> |
| | 114 | | System.Threading.Tasks.Task<PaymentDTO> PayPaymentRequestAsync(NewPaymentDTO newPaymentDTO = default(NewPaymentD |
| | 115 | |
|
| | 116 | | /// <summary> |
| | 117 | | /// Pay a payment request |
| | 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="newPaymentDTO"> (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 ApiResponse (PaymentDTO)</returns> |
| | 127 | | System.Threading.Tasks.Task<ApiResponse<PaymentDTO>> PayPaymentRequestWithHttpInfoAsync(NewPaymentDTO newPayment |
| | 128 | | #endregion Asynchronous Operations |
| | 129 | | } |
| | 130 | |
|
| | 131 | | /// <summary> |
| | 132 | | /// Represents a collection of functions to interact with the API endpoints |
| | 133 | | /// </summary> |
| | 134 | | public interface IPaymentsApi : IPaymentsApiSync, IPaymentsApiAsync |
| | 135 | | { |
| | 136 | |
|
| | 137 | | } |
| | 138 | |
|
| | 139 | | /// <summary> |
| | 140 | | /// Represents a collection of functions to interact with the API endpoints |
| | 141 | | /// </summary> |
| | 142 | | public partial class PaymentsApi : IPaymentsApi |
| | 143 | | { |
| 2 | 144 | | private Applications.WeShare.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; |
| | 145 | |
|
| | 146 | | /// <summary> |
| | 147 | | /// Initializes a new instance of the <see cref="PaymentsApi"/> class. |
| | 148 | | /// </summary> |
| | 149 | | /// <returns></returns> |
| 0 | 150 | | public PaymentsApi() : this((string)null) |
| 0 | 151 | | { |
| 0 | 152 | | } |
| | 153 | |
|
| | 154 | | /// <summary> |
| | 155 | | /// Initializes a new instance of the <see cref="PaymentsApi"/> class. |
| | 156 | | /// </summary> |
| | 157 | | /// <returns></returns> |
| 2 | 158 | | public PaymentsApi(string basePath) |
| 2 | 159 | | { |
| 2 | 160 | | this.Configuration = Applications.WeShare.Swagger.Client.Configuration.MergeConfigurations( |
| 2 | 161 | | Applications.WeShare.Swagger.Client.GlobalConfiguration.Instance, |
| 2 | 162 | | new Applications.WeShare.Swagger.Client.Configuration { BasePath = basePath } |
| 2 | 163 | | ); |
| 2 | 164 | | this.Client = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath); |
| 2 | 165 | | this.AsynchronousClient = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath); |
| 2 | 166 | | this.ExceptionFactory = Applications.WeShare.Swagger.Client.Configuration.DefaultExceptionFactory; |
| 2 | 167 | | } |
| | 168 | |
|
| | 169 | | /// <summary> |
| | 170 | | /// Initializes a new instance of the <see cref="PaymentsApi"/> class |
| | 171 | | /// using Configuration object |
| | 172 | | /// </summary> |
| | 173 | | /// <param name="configuration">An instance of Configuration</param> |
| | 174 | | /// <returns></returns> |
| 0 | 175 | | public PaymentsApi(Applications.WeShare.Swagger.Client.Configuration configuration) |
| 0 | 176 | | { |
| 0 | 177 | | if (configuration == null) throw new ArgumentNullException("configuration"); |
| | 178 | |
|
| 0 | 179 | | this.Configuration = Applications.WeShare.Swagger.Client.Configuration.MergeConfigurations( |
| 0 | 180 | | Applications.WeShare.Swagger.Client.GlobalConfiguration.Instance, |
| 0 | 181 | | configuration |
| 0 | 182 | | ); |
| 0 | 183 | | this.Client = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath); |
| 0 | 184 | | this.AsynchronousClient = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath); |
| 0 | 185 | | ExceptionFactory = Applications.WeShare.Swagger.Client.Configuration.DefaultExceptionFactory; |
| 0 | 186 | | } |
| | 187 | |
|
| | 188 | | /// <summary> |
| | 189 | | /// Initializes a new instance of the <see cref="PaymentsApi"/> class |
| | 190 | | /// using a Configuration object and client instance. |
| | 191 | | /// </summary> |
| | 192 | | /// <param name="client">The client interface for synchronous API access.</param> |
| | 193 | | /// <param name="asyncClient">The client interface for asynchronous API access.</param> |
| | 194 | | /// <param name="configuration">The configuration object.</param> |
| 0 | 195 | | public PaymentsApi(Applications.WeShare.Swagger.Client.ISynchronousClient client, Applications.WeShare.Swagger.C |
| 0 | 196 | | { |
| 0 | 197 | | if (client == null) throw new ArgumentNullException("client"); |
| 0 | 198 | | if (asyncClient == null) throw new ArgumentNullException("asyncClient"); |
| 0 | 199 | | if (configuration == null) throw new ArgumentNullException("configuration"); |
| | 200 | |
|
| 0 | 201 | | this.Client = client; |
| 0 | 202 | | this.AsynchronousClient = asyncClient; |
| 0 | 203 | | this.Configuration = configuration; |
| 0 | 204 | | this.ExceptionFactory = Applications.WeShare.Swagger.Client.Configuration.DefaultExceptionFactory; |
| 0 | 205 | | } |
| | 206 | |
|
| | 207 | | /// <summary> |
| | 208 | | /// The client for accessing this underlying API asynchronously. |
| | 209 | | /// </summary> |
| 2 | 210 | | public Applications.WeShare.Swagger.Client.IAsynchronousClient AsynchronousClient { get; set; } |
| | 211 | |
|
| | 212 | | /// <summary> |
| | 213 | | /// The client for accessing this underlying API synchronously. |
| | 214 | | /// </summary> |
| 6 | 215 | | public Applications.WeShare.Swagger.Client.ISynchronousClient Client { get; set; } |
| | 216 | |
|
| | 217 | | /// <summary> |
| | 218 | | /// Gets the base path of the API client. |
| | 219 | | /// </summary> |
| | 220 | | /// <value>The base path</value> |
| | 221 | | public string GetBasePath() |
| 0 | 222 | | { |
| 0 | 223 | | return this.Configuration.BasePath; |
| 0 | 224 | | } |
| | 225 | |
|
| | 226 | | /// <summary> |
| | 227 | | /// Gets or sets the configuration object |
| | 228 | | /// </summary> |
| | 229 | | /// <value>An instance of the Configuration</value> |
| 10 | 230 | | public Applications.WeShare.Swagger.Client.IReadableConfiguration Configuration { get; set; } |
| | 231 | |
|
| | 232 | | /// <summary> |
| | 233 | | /// Provides a factory method hook for the creation of exceptions. |
| | 234 | | /// </summary> |
| | 235 | | public Applications.WeShare.Swagger.Client.ExceptionFactory ExceptionFactory |
| | 236 | | { |
| | 237 | | get |
| 8 | 238 | | { |
| 8 | 239 | | if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) |
| 0 | 240 | | { |
| 0 | 241 | | throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); |
| | 242 | | } |
| 8 | 243 | | return _exceptionFactory; |
| 8 | 244 | | } |
| 6 | 245 | | set { _exceptionFactory = value; } |
| | 246 | | } |
| | 247 | |
|
| | 248 | | /// <summary> |
| | 249 | | /// Find all payments made by a person |
| | 250 | | /// </summary> |
| | 251 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 252 | | /// <param name="personId">The ID of the person</param> |
| | 253 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 254 | | /// <returns>List<PaymentDTO></returns> |
| | 255 | | public List<PaymentDTO> FindPaymentsMadeByPerson(int personId, int operationIndex = 0) |
| 1 | 256 | | { |
| 1 | 257 | | Applications.WeShare.Swagger.Client.ApiResponse<List<PaymentDTO>> localVarResponse = FindPaymentsMadeByPerso |
| 0 | 258 | | return localVarResponse.Data; |
| 0 | 259 | | } |
| | 260 | |
|
| | 261 | | /// <summary> |
| | 262 | | /// Find all payments made by a person |
| | 263 | | /// </summary> |
| | 264 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 265 | | /// <param name="personId">The ID of the person</param> |
| | 266 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 267 | | /// <returns>ApiResponse of List<PaymentDTO></returns> |
| | 268 | | public Applications.WeShare.Swagger.Client.ApiResponse<List<PaymentDTO>> FindPaymentsMadeByPersonWithHttpInfo(in |
| 2 | 269 | | { |
| 2 | 270 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 271 | |
|
| 2 | 272 | | string[] _contentTypes = new string[] { |
| 2 | 273 | | }; |
| | 274 | |
|
| | 275 | | // to determine the Accept header |
| 2 | 276 | | string[] _accepts = new string[] { |
| 2 | 277 | | "application/json" |
| 2 | 278 | | }; |
| | 279 | |
|
| 2 | 280 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 2 | 281 | | if (localVarContentType != null) |
| 0 | 282 | | { |
| 0 | 283 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 0 | 284 | | } |
| | 285 | |
|
| 2 | 286 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 2 | 287 | | if (localVarAccept != null) |
| 2 | 288 | | { |
| 2 | 289 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 2 | 290 | | } |
| | 291 | |
|
| 2 | 292 | | localVarRequestOptions.PathParameters.Add("personId", Applications.WeShare.Swagger.Client.ClientUtils.Parame |
| | 293 | |
|
| 2 | 294 | | localVarRequestOptions.Operation = "PaymentsApi.FindPaymentsMadeByPerson"; |
| 2 | 295 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 296 | |
|
| | 297 | |
|
| | 298 | | // make the HTTP request |
| 2 | 299 | | var localVarResponse = this.Client.Get<List<PaymentDTO>>("/api/payments/madeby/{personId}", localVarRequestO |
| 2 | 300 | | if (this.ExceptionFactory != null) |
| 2 | 301 | | { |
| 2 | 302 | | Exception _exception = this.ExceptionFactory("FindPaymentsMadeByPerson", localVarResponse); |
| 2 | 303 | | if (_exception != null) |
| 1 | 304 | | { |
| 1 | 305 | | throw _exception; |
| | 306 | | } |
| 1 | 307 | | } |
| | 308 | |
|
| 1 | 309 | | return localVarResponse; |
| 1 | 310 | | } |
| | 311 | |
|
| | 312 | | /// <summary> |
| | 313 | | /// Find all payments made by a person |
| | 314 | | /// </summary> |
| | 315 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 316 | | /// <param name="personId">The ID of the person</param> |
| | 317 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 318 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 319 | | /// <returns>Task of List<PaymentDTO></returns> |
| | 320 | | public async System.Threading.Tasks.Task<List<PaymentDTO>> FindPaymentsMadeByPersonAsync(int personId, int opera |
| 0 | 321 | | { |
| 0 | 322 | | Applications.WeShare.Swagger.Client.ApiResponse<List<PaymentDTO>> localVarResponse = await FindPaymentsMadeB |
| 0 | 323 | | return localVarResponse.Data; |
| 0 | 324 | | } |
| | 325 | |
|
| | 326 | | /// <summary> |
| | 327 | | /// Find all payments made by a person |
| | 328 | | /// </summary> |
| | 329 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 330 | | /// <param name="personId">The ID of the person</param> |
| | 331 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 332 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 333 | | /// <returns>Task of ApiResponse (List<PaymentDTO>)</returns> |
| | 334 | | public async System.Threading.Tasks.Task<Applications.WeShare.Swagger.Client.ApiResponse<List<PaymentDTO>>> Find |
| 0 | 335 | | { |
| | 336 | |
|
| 0 | 337 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 338 | |
|
| 0 | 339 | | string[] _contentTypes = new string[] { |
| 0 | 340 | | }; |
| | 341 | |
|
| | 342 | | // to determine the Accept header |
| 0 | 343 | | string[] _accepts = new string[] { |
| 0 | 344 | | "application/json" |
| 0 | 345 | | }; |
| | 346 | |
|
| 0 | 347 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 0 | 348 | | if (localVarContentType != null) |
| 0 | 349 | | { |
| 0 | 350 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 0 | 351 | | } |
| | 352 | |
|
| 0 | 353 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 0 | 354 | | if (localVarAccept != null) |
| 0 | 355 | | { |
| 0 | 356 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 0 | 357 | | } |
| | 358 | |
|
| 0 | 359 | | localVarRequestOptions.PathParameters.Add("personId", Applications.WeShare.Swagger.Client.ClientUtils.Parame |
| | 360 | |
|
| 0 | 361 | | localVarRequestOptions.Operation = "PaymentsApi.FindPaymentsMadeByPerson"; |
| 0 | 362 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 363 | |
|
| | 364 | |
|
| | 365 | | // make the HTTP request |
| 0 | 366 | | var localVarResponse = await this.AsynchronousClient.GetAsync<List<PaymentDTO>>("/api/payments/madeby/{perso |
| | 367 | |
|
| 0 | 368 | | if (this.ExceptionFactory != null) |
| 0 | 369 | | { |
| 0 | 370 | | Exception _exception = this.ExceptionFactory("FindPaymentsMadeByPerson", localVarResponse); |
| 0 | 371 | | if (_exception != null) |
| 0 | 372 | | { |
| 0 | 373 | | throw _exception; |
| | 374 | | } |
| 0 | 375 | | } |
| | 376 | |
|
| 0 | 377 | | return localVarResponse; |
| 0 | 378 | | } |
| | 379 | |
|
| | 380 | | /// <summary> |
| | 381 | | /// Pay a payment request |
| | 382 | | /// </summary> |
| | 383 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 384 | | /// <param name="newPaymentDTO"> (optional)</param> |
| | 385 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 386 | | /// <returns>PaymentDTO</returns> |
| | 387 | | public PaymentDTO PayPaymentRequest(NewPaymentDTO newPaymentDTO = default(NewPaymentDTO), int operationIndex = 0 |
| 2 | 388 | | { |
| 2 | 389 | | Applications.WeShare.Swagger.Client.ApiResponse<PaymentDTO> localVarResponse = PayPaymentRequestWithHttpInfo |
| 0 | 390 | | return localVarResponse.Data; |
| 0 | 391 | | } |
| | 392 | |
|
| | 393 | | /// <summary> |
| | 394 | | /// Pay a payment request |
| | 395 | | /// </summary> |
| | 396 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 397 | | /// <param name="newPaymentDTO"> (optional)</param> |
| | 398 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 399 | | /// <returns>ApiResponse of PaymentDTO</returns> |
| | 400 | | public Applications.WeShare.Swagger.Client.ApiResponse<PaymentDTO> PayPaymentRequestWithHttpInfo(NewPaymentDTO n |
| 2 | 401 | | { |
| 2 | 402 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 403 | |
|
| 2 | 404 | | string[] _contentTypes = new string[] { |
| 2 | 405 | | "application/json" |
| 2 | 406 | | }; |
| | 407 | |
|
| | 408 | | // to determine the Accept header |
| 2 | 409 | | string[] _accepts = new string[] { |
| 2 | 410 | | "application/json" |
| 2 | 411 | | }; |
| | 412 | |
|
| 2 | 413 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 2 | 414 | | if (localVarContentType != null) |
| 2 | 415 | | { |
| 2 | 416 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 2 | 417 | | } |
| | 418 | |
|
| 2 | 419 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 2 | 420 | | if (localVarAccept != null) |
| 2 | 421 | | { |
| 2 | 422 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 2 | 423 | | } |
| | 424 | |
|
| 2 | 425 | | localVarRequestOptions.Data = newPaymentDTO; |
| | 426 | |
|
| 2 | 427 | | localVarRequestOptions.Operation = "PaymentsApi.PayPaymentRequest"; |
| 2 | 428 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 429 | |
|
| | 430 | |
|
| | 431 | | // make the HTTP request |
| 2 | 432 | | var localVarResponse = this.Client.Post<PaymentDTO>("/api/payments", localVarRequestOptions, this.Configurat |
| 2 | 433 | | if (this.ExceptionFactory != null) |
| 2 | 434 | | { |
| 2 | 435 | | Exception _exception = this.ExceptionFactory("PayPaymentRequest", localVarResponse); |
| 2 | 436 | | if (_exception != null) |
| 2 | 437 | | { |
| 2 | 438 | | throw _exception; |
| | 439 | | } |
| 0 | 440 | | } |
| | 441 | |
|
| 0 | 442 | | return localVarResponse; |
| 0 | 443 | | } |
| | 444 | |
|
| | 445 | | /// <summary> |
| | 446 | | /// Pay a payment request |
| | 447 | | /// </summary> |
| | 448 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 449 | | /// <param name="newPaymentDTO"> (optional)</param> |
| | 450 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 451 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 452 | | /// <returns>Task of PaymentDTO</returns> |
| | 453 | | public async System.Threading.Tasks.Task<PaymentDTO> PayPaymentRequestAsync(NewPaymentDTO newPaymentDTO = defaul |
| 0 | 454 | | { |
| 0 | 455 | | Applications.WeShare.Swagger.Client.ApiResponse<PaymentDTO> localVarResponse = await PayPaymentRequestWithHt |
| 0 | 456 | | return localVarResponse.Data; |
| 0 | 457 | | } |
| | 458 | |
|
| | 459 | | /// <summary> |
| | 460 | | /// Pay a payment request |
| | 461 | | /// </summary> |
| | 462 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 463 | | /// <param name="newPaymentDTO"> (optional)</param> |
| | 464 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 465 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 466 | | /// <returns>Task of ApiResponse (PaymentDTO)</returns> |
| | 467 | | public async System.Threading.Tasks.Task<Applications.WeShare.Swagger.Client.ApiResponse<PaymentDTO>> PayPayment |
| 0 | 468 | | { |
| | 469 | |
|
| 0 | 470 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 471 | |
|
| 0 | 472 | | string[] _contentTypes = new string[] { |
| 0 | 473 | | "application/json" |
| 0 | 474 | | }; |
| | 475 | |
|
| | 476 | | // to determine the Accept header |
| 0 | 477 | | string[] _accepts = new string[] { |
| 0 | 478 | | "application/json" |
| 0 | 479 | | }; |
| | 480 | |
|
| 0 | 481 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 0 | 482 | | if (localVarContentType != null) |
| 0 | 483 | | { |
| 0 | 484 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 0 | 485 | | } |
| | 486 | |
|
| 0 | 487 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 0 | 488 | | if (localVarAccept != null) |
| 0 | 489 | | { |
| 0 | 490 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 0 | 491 | | } |
| | 492 | |
|
| 0 | 493 | | localVarRequestOptions.Data = newPaymentDTO; |
| | 494 | |
|
| 0 | 495 | | localVarRequestOptions.Operation = "PaymentsApi.PayPaymentRequest"; |
| 0 | 496 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 497 | |
|
| | 498 | |
|
| | 499 | | // make the HTTP request |
| 0 | 500 | | var localVarResponse = await this.AsynchronousClient.PostAsync<PaymentDTO>("/api/payments", localVarRequestO |
| | 501 | |
|
| 0 | 502 | | if (this.ExceptionFactory != null) |
| 0 | 503 | | { |
| 0 | 504 | | Exception _exception = this.ExceptionFactory("PayPaymentRequest", localVarResponse); |
| 0 | 505 | | if (_exception != null) |
| 0 | 506 | | { |
| 0 | 507 | | throw _exception; |
| | 508 | | } |
| 0 | 509 | | } |
| | 510 | |
|
| 0 | 511 | | return localVarResponse; |
| 0 | 512 | | } |
| | 513 | |
|
| | 514 | | } |
| | 515 | | } |