| | 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 IPeopleApiSync : IApiAccessor |
| | 27 | | { |
| | 28 | | #region Synchronous Operations |
| | 29 | | /// <summary> |
| | 30 | | /// Find all people that use WeShare |
| | 31 | | /// </summary> |
| | 32 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 33 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 34 | | /// <returns>List<Person></returns> |
| | 35 | | List<Person> FindAllPeople(int operationIndex = 0); |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// Find all people that use WeShare |
| | 39 | | /// </summary> |
| | 40 | | /// <remarks> |
| | 41 | | /// |
| | 42 | | /// </remarks> |
| | 43 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 44 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 45 | | /// <returns>ApiResponse of List<Person></returns> |
| | 46 | | ApiResponse<List<Person>> FindAllPeopleWithHttpInfo(int operationIndex = 0); |
| | 47 | | /// <summary> |
| | 48 | | /// Find a person by ID |
| | 49 | | /// </summary> |
| | 50 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 51 | | /// <param name="personId">The ID of the person</param> |
| | 52 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 53 | | /// <returns>Person</returns> |
| | 54 | | Person FindPersonById(int personId, int operationIndex = 0); |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Find a person by ID |
| | 58 | | /// </summary> |
| | 59 | | /// <remarks> |
| | 60 | | /// |
| | 61 | | /// </remarks> |
| | 62 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 63 | | /// <param name="personId">The ID of the person</param> |
| | 64 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 65 | | /// <returns>ApiResponse of Person</returns> |
| | 66 | | ApiResponse<Person> FindPersonByIdWithHttpInfo(int personId, int operationIndex = 0); |
| | 67 | | /// <summary> |
| | 68 | | /// Login to WeShare |
| | 69 | | /// </summary> |
| | 70 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 71 | | /// <param name="loginDTO"> (optional)</param> |
| | 72 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 73 | | /// <returns>Person</returns> |
| | 74 | | Person Login(LoginDTO loginDTO = default(LoginDTO), int operationIndex = 0); |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Login to WeShare |
| | 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="loginDTO"> (optional)</param> |
| | 84 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 85 | | /// <returns>ApiResponse of Person</returns> |
| | 86 | | ApiResponse<Person> LoginWithHttpInfo(LoginDTO loginDTO = default(LoginDTO), int operationIndex = 0); |
| | 87 | | #endregion Synchronous Operations |
| | 88 | | } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// Represents a collection of functions to interact with the API endpoints |
| | 92 | | /// </summary> |
| | 93 | | public interface IPeopleApiAsync : IApiAccessor |
| | 94 | | { |
| | 95 | | #region Asynchronous Operations |
| | 96 | | /// <summary> |
| | 97 | | /// Find all people that use WeShare |
| | 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="operationIndex">Index associated with the operation.</param> |
| | 104 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 105 | | /// <returns>Task of List<Person></returns> |
| | 106 | | System.Threading.Tasks.Task<List<Person>> FindAllPeopleAsync(int operationIndex = 0, System.Threading.Cancellati |
| | 107 | |
|
| | 108 | | /// <summary> |
| | 109 | | /// Find all people that use WeShare |
| | 110 | | /// </summary> |
| | 111 | | /// <remarks> |
| | 112 | | /// |
| | 113 | | /// </remarks> |
| | 114 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 115 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 116 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 117 | | /// <returns>Task of ApiResponse (List<Person>)</returns> |
| | 118 | | System.Threading.Tasks.Task<ApiResponse<List<Person>>> FindAllPeopleWithHttpInfoAsync(int operationIndex = 0, Sy |
| | 119 | | /// <summary> |
| | 120 | | /// Find a person by ID |
| | 121 | | /// </summary> |
| | 122 | | /// <remarks> |
| | 123 | | /// |
| | 124 | | /// </remarks> |
| | 125 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 126 | | /// <param name="personId">The ID of the person</param> |
| | 127 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 128 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 129 | | /// <returns>Task of Person</returns> |
| | 130 | | System.Threading.Tasks.Task<Person> FindPersonByIdAsync(int personId, int operationIndex = 0, System.Threading.C |
| | 131 | |
|
| | 132 | | /// <summary> |
| | 133 | | /// Find a person by ID |
| | 134 | | /// </summary> |
| | 135 | | /// <remarks> |
| | 136 | | /// |
| | 137 | | /// </remarks> |
| | 138 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 139 | | /// <param name="personId">The ID of the person</param> |
| | 140 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 141 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 142 | | /// <returns>Task of ApiResponse (Person)</returns> |
| | 143 | | System.Threading.Tasks.Task<ApiResponse<Person>> FindPersonByIdWithHttpInfoAsync(int personId, int operationInde |
| | 144 | | /// <summary> |
| | 145 | | /// Login to WeShare |
| | 146 | | /// </summary> |
| | 147 | | /// <remarks> |
| | 148 | | /// |
| | 149 | | /// </remarks> |
| | 150 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 151 | | /// <param name="loginDTO"> (optional)</param> |
| | 152 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 153 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 154 | | /// <returns>Task of Person</returns> |
| | 155 | | System.Threading.Tasks.Task<Person> LoginAsync(LoginDTO loginDTO = default(LoginDTO), int operationIndex = 0, Sy |
| | 156 | |
|
| | 157 | | /// <summary> |
| | 158 | | /// Login to WeShare |
| | 159 | | /// </summary> |
| | 160 | | /// <remarks> |
| | 161 | | /// |
| | 162 | | /// </remarks> |
| | 163 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 164 | | /// <param name="loginDTO"> (optional)</param> |
| | 165 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 166 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 167 | | /// <returns>Task of ApiResponse (Person)</returns> |
| | 168 | | System.Threading.Tasks.Task<ApiResponse<Person>> LoginWithHttpInfoAsync(LoginDTO loginDTO = default(LoginDTO), i |
| | 169 | | #endregion Asynchronous Operations |
| | 170 | | } |
| | 171 | |
|
| | 172 | | /// <summary> |
| | 173 | | /// Represents a collection of functions to interact with the API endpoints |
| | 174 | | /// </summary> |
| | 175 | | public interface IPeopleApi : IPeopleApiSync, IPeopleApiAsync |
| | 176 | | { |
| | 177 | |
|
| | 178 | | } |
| | 179 | |
|
| | 180 | | /// <summary> |
| | 181 | | /// Represents a collection of functions to interact with the API endpoints |
| | 182 | | /// </summary> |
| | 183 | | public partial class PeopleApi : IPeopleApi |
| | 184 | | { |
| 2 | 185 | | private Applications.WeShare.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; |
| | 186 | |
|
| | 187 | | /// <summary> |
| | 188 | | /// Initializes a new instance of the <see cref="PeopleApi"/> class. |
| | 189 | | /// </summary> |
| | 190 | | /// <returns></returns> |
| 0 | 191 | | public PeopleApi() : this((string)null) |
| 0 | 192 | | { |
| 0 | 193 | | } |
| | 194 | |
|
| | 195 | | /// <summary> |
| | 196 | | /// Initializes a new instance of the <see cref="PeopleApi"/> class. |
| | 197 | | /// </summary> |
| | 198 | | /// <returns></returns> |
| 2 | 199 | | public PeopleApi(string basePath) |
| 2 | 200 | | { |
| 2 | 201 | | this.Configuration = Applications.WeShare.Swagger.Client.Configuration.MergeConfigurations( |
| 2 | 202 | | Applications.WeShare.Swagger.Client.GlobalConfiguration.Instance, |
| 2 | 203 | | new Applications.WeShare.Swagger.Client.Configuration { BasePath = basePath } |
| 2 | 204 | | ); |
| 2 | 205 | | this.Client = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath); |
| 2 | 206 | | this.AsynchronousClient = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath); |
| 2 | 207 | | this.ExceptionFactory = Applications.WeShare.Swagger.Client.Configuration.DefaultExceptionFactory; |
| 2 | 208 | | } |
| | 209 | |
|
| | 210 | | /// <summary> |
| | 211 | | /// Initializes a new instance of the <see cref="PeopleApi"/> class |
| | 212 | | /// using Configuration object |
| | 213 | | /// </summary> |
| | 214 | | /// <param name="configuration">An instance of Configuration</param> |
| | 215 | | /// <returns></returns> |
| 0 | 216 | | public PeopleApi(Applications.WeShare.Swagger.Client.Configuration configuration) |
| 0 | 217 | | { |
| 0 | 218 | | if (configuration == null) throw new ArgumentNullException("configuration"); |
| | 219 | |
|
| 0 | 220 | | this.Configuration = Applications.WeShare.Swagger.Client.Configuration.MergeConfigurations( |
| 0 | 221 | | Applications.WeShare.Swagger.Client.GlobalConfiguration.Instance, |
| 0 | 222 | | configuration |
| 0 | 223 | | ); |
| 0 | 224 | | this.Client = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath); |
| 0 | 225 | | this.AsynchronousClient = new Applications.WeShare.Swagger.Client.ApiClient(this.Configuration.BasePath); |
| 0 | 226 | | ExceptionFactory = Applications.WeShare.Swagger.Client.Configuration.DefaultExceptionFactory; |
| 0 | 227 | | } |
| | 228 | |
|
| | 229 | | /// <summary> |
| | 230 | | /// Initializes a new instance of the <see cref="PeopleApi"/> class |
| | 231 | | /// using a Configuration object and client instance. |
| | 232 | | /// </summary> |
| | 233 | | /// <param name="client">The client interface for synchronous API access.</param> |
| | 234 | | /// <param name="asyncClient">The client interface for asynchronous API access.</param> |
| | 235 | | /// <param name="configuration">The configuration object.</param> |
| 0 | 236 | | public PeopleApi(Applications.WeShare.Swagger.Client.ISynchronousClient client, Applications.WeShare.Swagger.Cli |
| 0 | 237 | | { |
| 0 | 238 | | if (client == null) throw new ArgumentNullException("client"); |
| 0 | 239 | | if (asyncClient == null) throw new ArgumentNullException("asyncClient"); |
| 0 | 240 | | if (configuration == null) throw new ArgumentNullException("configuration"); |
| | 241 | |
|
| 0 | 242 | | this.Client = client; |
| 0 | 243 | | this.AsynchronousClient = asyncClient; |
| 0 | 244 | | this.Configuration = configuration; |
| 0 | 245 | | this.ExceptionFactory = Applications.WeShare.Swagger.Client.Configuration.DefaultExceptionFactory; |
| 0 | 246 | | } |
| | 247 | |
|
| | 248 | | /// <summary> |
| | 249 | | /// The client for accessing this underlying API asynchronously. |
| | 250 | | /// </summary> |
| 2 | 251 | | public Applications.WeShare.Swagger.Client.IAsynchronousClient AsynchronousClient { get; set; } |
| | 252 | |
|
| | 253 | | /// <summary> |
| | 254 | | /// The client for accessing this underlying API synchronously. |
| | 255 | | /// </summary> |
| 8 | 256 | | public Applications.WeShare.Swagger.Client.ISynchronousClient Client { get; set; } |
| | 257 | |
|
| | 258 | | /// <summary> |
| | 259 | | /// Gets the base path of the API client. |
| | 260 | | /// </summary> |
| | 261 | | /// <value>The base path</value> |
| | 262 | | public string GetBasePath() |
| 0 | 263 | | { |
| 0 | 264 | | return this.Configuration.BasePath; |
| 0 | 265 | | } |
| | 266 | |
|
| | 267 | | /// <summary> |
| | 268 | | /// Gets or sets the configuration object |
| | 269 | | /// </summary> |
| | 270 | | /// <value>An instance of the Configuration</value> |
| 12 | 271 | | public Applications.WeShare.Swagger.Client.IReadableConfiguration Configuration { get; set; } |
| | 272 | |
|
| | 273 | | /// <summary> |
| | 274 | | /// Provides a factory method hook for the creation of exceptions. |
| | 275 | | /// </summary> |
| | 276 | | public Applications.WeShare.Swagger.Client.ExceptionFactory ExceptionFactory |
| | 277 | | { |
| | 278 | | get |
| 12 | 279 | | { |
| 12 | 280 | | if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) |
| 0 | 281 | | { |
| 0 | 282 | | throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); |
| | 283 | | } |
| 12 | 284 | | return _exceptionFactory; |
| 12 | 285 | | } |
| 6 | 286 | | set { _exceptionFactory = value; } |
| | 287 | | } |
| | 288 | |
|
| | 289 | | /// <summary> |
| | 290 | | /// Find all people that use WeShare |
| | 291 | | /// </summary> |
| | 292 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 293 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 294 | | /// <returns>List<Person></returns> |
| | 295 | | public List<Person> FindAllPeople(int operationIndex = 0) |
| 1 | 296 | | { |
| 1 | 297 | | Applications.WeShare.Swagger.Client.ApiResponse<List<Person>> localVarResponse = FindAllPeopleWithHttpInfo() |
| 0 | 298 | | return localVarResponse.Data; |
| 0 | 299 | | } |
| | 300 | |
|
| | 301 | | /// <summary> |
| | 302 | | /// Find all people that use WeShare |
| | 303 | | /// </summary> |
| | 304 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 305 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 306 | | /// <returns>ApiResponse of List<Person></returns> |
| | 307 | | public Applications.WeShare.Swagger.Client.ApiResponse<List<Person>> FindAllPeopleWithHttpInfo(int operationInde |
| 1 | 308 | | { |
| 1 | 309 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 310 | |
|
| 1 | 311 | | string[] _contentTypes = new string[] { |
| 1 | 312 | | }; |
| | 313 | |
|
| | 314 | | // to determine the Accept header |
| 1 | 315 | | string[] _accepts = new string[] { |
| 1 | 316 | | "application/json" |
| 1 | 317 | | }; |
| | 318 | |
|
| 1 | 319 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 1 | 320 | | if (localVarContentType != null) |
| 0 | 321 | | { |
| 0 | 322 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 0 | 323 | | } |
| | 324 | |
|
| 1 | 325 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 1 | 326 | | if (localVarAccept != null) |
| 1 | 327 | | { |
| 1 | 328 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 1 | 329 | | } |
| | 330 | |
|
| | 331 | |
|
| 1 | 332 | | localVarRequestOptions.Operation = "PeopleApi.FindAllPeople"; |
| 1 | 333 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 334 | |
|
| | 335 | |
|
| | 336 | | // make the HTTP request |
| 1 | 337 | | var localVarResponse = this.Client.Get<List<Person>>("/people", localVarRequestOptions, this.Configuration); |
| 1 | 338 | | if (this.ExceptionFactory != null) |
| 1 | 339 | | { |
| 1 | 340 | | Exception _exception = this.ExceptionFactory("FindAllPeople", localVarResponse); |
| 1 | 341 | | if (_exception != null) |
| 1 | 342 | | { |
| 1 | 343 | | throw _exception; |
| | 344 | | } |
| 0 | 345 | | } |
| | 346 | |
|
| 0 | 347 | | return localVarResponse; |
| 0 | 348 | | } |
| | 349 | |
|
| | 350 | | /// <summary> |
| | 351 | | /// Find all people that use WeShare |
| | 352 | | /// </summary> |
| | 353 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 354 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 355 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 356 | | /// <returns>Task of List<Person></returns> |
| | 357 | | public async System.Threading.Tasks.Task<List<Person>> FindAllPeopleAsync(int operationIndex = 0, System.Threadi |
| 0 | 358 | | { |
| 0 | 359 | | Applications.WeShare.Swagger.Client.ApiResponse<List<Person>> localVarResponse = await FindAllPeopleWithHttp |
| 0 | 360 | | return localVarResponse.Data; |
| 0 | 361 | | } |
| | 362 | |
|
| | 363 | | /// <summary> |
| | 364 | | /// Find all people that use WeShare |
| | 365 | | /// </summary> |
| | 366 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 367 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 368 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 369 | | /// <returns>Task of ApiResponse (List<Person>)</returns> |
| | 370 | | public async System.Threading.Tasks.Task<Applications.WeShare.Swagger.Client.ApiResponse<List<Person>>> FindAllP |
| 0 | 371 | | { |
| | 372 | |
|
| 0 | 373 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 374 | |
|
| 0 | 375 | | string[] _contentTypes = new string[] { |
| 0 | 376 | | }; |
| | 377 | |
|
| | 378 | | // to determine the Accept header |
| 0 | 379 | | string[] _accepts = new string[] { |
| 0 | 380 | | "application/json" |
| 0 | 381 | | }; |
| | 382 | |
|
| 0 | 383 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 0 | 384 | | if (localVarContentType != null) |
| 0 | 385 | | { |
| 0 | 386 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 0 | 387 | | } |
| | 388 | |
|
| 0 | 389 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 0 | 390 | | if (localVarAccept != null) |
| 0 | 391 | | { |
| 0 | 392 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 0 | 393 | | } |
| | 394 | |
|
| | 395 | |
|
| 0 | 396 | | localVarRequestOptions.Operation = "PeopleApi.FindAllPeople"; |
| 0 | 397 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 398 | |
|
| | 399 | |
|
| | 400 | | // make the HTTP request |
| 0 | 401 | | var localVarResponse = await this.AsynchronousClient.GetAsync<List<Person>>("/people", localVarRequestOption |
| | 402 | |
|
| 0 | 403 | | if (this.ExceptionFactory != null) |
| 0 | 404 | | { |
| 0 | 405 | | Exception _exception = this.ExceptionFactory("FindAllPeople", localVarResponse); |
| 0 | 406 | | if (_exception != null) |
| 0 | 407 | | { |
| 0 | 408 | | throw _exception; |
| | 409 | | } |
| 0 | 410 | | } |
| | 411 | |
|
| 0 | 412 | | return localVarResponse; |
| 0 | 413 | | } |
| | 414 | |
|
| | 415 | | /// <summary> |
| | 416 | | /// Find a person by ID |
| | 417 | | /// </summary> |
| | 418 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 419 | | /// <param name="personId">The ID of the person</param> |
| | 420 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 421 | | /// <returns>Person</returns> |
| | 422 | | public Person FindPersonById(int personId, int operationIndex = 0) |
| 3 | 423 | | { |
| 3 | 424 | | Applications.WeShare.Swagger.Client.ApiResponse<Person> localVarResponse = FindPersonByIdWithHttpInfo(person |
| 1 | 425 | | return localVarResponse.Data; |
| 1 | 426 | | } |
| | 427 | |
|
| | 428 | | /// <summary> |
| | 429 | | /// Find a person by ID |
| | 430 | | /// </summary> |
| | 431 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 432 | | /// <param name="personId">The ID of the person</param> |
| | 433 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 434 | | /// <returns>ApiResponse of Person</returns> |
| | 435 | | public Applications.WeShare.Swagger.Client.ApiResponse<Person> FindPersonByIdWithHttpInfo(int personId, int oper |
| 3 | 436 | | { |
| 3 | 437 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 438 | |
|
| 3 | 439 | | string[] _contentTypes = new string[] { |
| 3 | 440 | | }; |
| | 441 | |
|
| | 442 | | // to determine the Accept header |
| 3 | 443 | | string[] _accepts = new string[] { |
| 3 | 444 | | "application/json" |
| 3 | 445 | | }; |
| | 446 | |
|
| 3 | 447 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 3 | 448 | | if (localVarContentType != null) |
| 0 | 449 | | { |
| 0 | 450 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 0 | 451 | | } |
| | 452 | |
|
| 3 | 453 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 3 | 454 | | if (localVarAccept != null) |
| 3 | 455 | | { |
| 3 | 456 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 3 | 457 | | } |
| | 458 | |
|
| 3 | 459 | | localVarRequestOptions.PathParameters.Add("personId", Applications.WeShare.Swagger.Client.ClientUtils.Parame |
| | 460 | |
|
| 3 | 461 | | localVarRequestOptions.Operation = "PeopleApi.FindPersonById"; |
| 3 | 462 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 463 | |
|
| | 464 | |
|
| | 465 | | // make the HTTP request |
| 3 | 466 | | var localVarResponse = this.Client.Get<Person>("/api/people/{personId}", localVarRequestOptions, this.Config |
| 3 | 467 | | if (this.ExceptionFactory != null) |
| 3 | 468 | | { |
| 3 | 469 | | Exception _exception = this.ExceptionFactory("FindPersonById", localVarResponse); |
| 3 | 470 | | if (_exception != null) |
| 2 | 471 | | { |
| 2 | 472 | | throw _exception; |
| | 473 | | } |
| 1 | 474 | | } |
| | 475 | |
|
| 1 | 476 | | return localVarResponse; |
| 1 | 477 | | } |
| | 478 | |
|
| | 479 | | /// <summary> |
| | 480 | | /// Find a person by ID |
| | 481 | | /// </summary> |
| | 482 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 483 | | /// <param name="personId">The ID of the person</param> |
| | 484 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 485 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 486 | | /// <returns>Task of Person</returns> |
| | 487 | | public async System.Threading.Tasks.Task<Person> FindPersonByIdAsync(int personId, int operationIndex = 0, Syste |
| 0 | 488 | | { |
| 0 | 489 | | Applications.WeShare.Swagger.Client.ApiResponse<Person> localVarResponse = await FindPersonByIdWithHttpInfoA |
| 0 | 490 | | return localVarResponse.Data; |
| 0 | 491 | | } |
| | 492 | |
|
| | 493 | | /// <summary> |
| | 494 | | /// Find a person by ID |
| | 495 | | /// </summary> |
| | 496 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 497 | | /// <param name="personId">The ID of the person</param> |
| | 498 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 499 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 500 | | /// <returns>Task of ApiResponse (Person)</returns> |
| | 501 | | public async System.Threading.Tasks.Task<Applications.WeShare.Swagger.Client.ApiResponse<Person>> FindPersonById |
| 0 | 502 | | { |
| | 503 | |
|
| 0 | 504 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 505 | |
|
| 0 | 506 | | string[] _contentTypes = new string[] { |
| 0 | 507 | | }; |
| | 508 | |
|
| | 509 | | // to determine the Accept header |
| 0 | 510 | | string[] _accepts = new string[] { |
| 0 | 511 | | "application/json" |
| 0 | 512 | | }; |
| | 513 | |
|
| 0 | 514 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 0 | 515 | | if (localVarContentType != null) |
| 0 | 516 | | { |
| 0 | 517 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 0 | 518 | | } |
| | 519 | |
|
| 0 | 520 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 0 | 521 | | if (localVarAccept != null) |
| 0 | 522 | | { |
| 0 | 523 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 0 | 524 | | } |
| | 525 | |
|
| 0 | 526 | | localVarRequestOptions.PathParameters.Add("personId", Applications.WeShare.Swagger.Client.ClientUtils.Parame |
| | 527 | |
|
| 0 | 528 | | localVarRequestOptions.Operation = "PeopleApi.FindPersonById"; |
| 0 | 529 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 530 | |
|
| | 531 | |
|
| | 532 | | // make the HTTP request |
| 0 | 533 | | var localVarResponse = await this.AsynchronousClient.GetAsync<Person>("/api/people/{personId}", localVarRequ |
| | 534 | |
|
| 0 | 535 | | if (this.ExceptionFactory != null) |
| 0 | 536 | | { |
| 0 | 537 | | Exception _exception = this.ExceptionFactory("FindPersonById", localVarResponse); |
| 0 | 538 | | if (_exception != null) |
| 0 | 539 | | { |
| 0 | 540 | | throw _exception; |
| | 541 | | } |
| 0 | 542 | | } |
| | 543 | |
|
| 0 | 544 | | return localVarResponse; |
| 0 | 545 | | } |
| | 546 | |
|
| | 547 | | /// <summary> |
| | 548 | | /// Login to WeShare |
| | 549 | | /// </summary> |
| | 550 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 551 | | /// <param name="loginDTO"> (optional)</param> |
| | 552 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 553 | | /// <returns>Person</returns> |
| | 554 | | public Person Login(LoginDTO loginDTO = default(LoginDTO), int operationIndex = 0) |
| 0 | 555 | | { |
| 0 | 556 | | Applications.WeShare.Swagger.Client.ApiResponse<Person> localVarResponse = LoginWithHttpInfo(loginDTO); |
| 0 | 557 | | return localVarResponse.Data; |
| 0 | 558 | | } |
| | 559 | |
|
| | 560 | | /// <summary> |
| | 561 | | /// Login to WeShare |
| | 562 | | /// </summary> |
| | 563 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 564 | | /// <param name="loginDTO"> (optional)</param> |
| | 565 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 566 | | /// <returns>ApiResponse of Person</returns> |
| | 567 | | public Applications.WeShare.Swagger.Client.ApiResponse<Person> LoginWithHttpInfo(LoginDTO loginDTO = default(Log |
| 2 | 568 | | { |
| 2 | 569 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 570 | |
|
| 2 | 571 | | string[] _contentTypes = new string[] { |
| 2 | 572 | | "application/json" |
| 2 | 573 | | }; |
| | 574 | |
|
| | 575 | | // to determine the Accept header |
| 2 | 576 | | string[] _accepts = new string[] { |
| 2 | 577 | | "application/json" |
| 2 | 578 | | }; |
| | 579 | |
|
| 2 | 580 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 2 | 581 | | if (localVarContentType != null) |
| 2 | 582 | | { |
| 2 | 583 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 2 | 584 | | } |
| | 585 | |
|
| 2 | 586 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 2 | 587 | | if (localVarAccept != null) |
| 2 | 588 | | { |
| 2 | 589 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 2 | 590 | | } |
| | 591 | |
|
| 2 | 592 | | localVarRequestOptions.Data = loginDTO; |
| | 593 | |
|
| 2 | 594 | | localVarRequestOptions.Operation = "PeopleApi.Login"; |
| 2 | 595 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 596 | |
|
| | 597 | |
|
| | 598 | | // make the HTTP request |
| 2 | 599 | | var localVarResponse = this.Client.Post<Person>("/api/people", localVarRequestOptions, this.Configuration); |
| 2 | 600 | | if (this.ExceptionFactory != null) |
| 2 | 601 | | { |
| 2 | 602 | | Exception _exception = this.ExceptionFactory("Login", localVarResponse); |
| 2 | 603 | | if (_exception != null) |
| 1 | 604 | | { |
| 1 | 605 | | throw _exception; |
| | 606 | | } |
| 1 | 607 | | } |
| | 608 | |
|
| 1 | 609 | | return localVarResponse; |
| 1 | 610 | | } |
| | 611 | |
|
| | 612 | | /// <summary> |
| | 613 | | /// Login to WeShare |
| | 614 | | /// </summary> |
| | 615 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 616 | | /// <param name="loginDTO"> (optional)</param> |
| | 617 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 618 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 619 | | /// <returns>Task of Person</returns> |
| | 620 | | public async System.Threading.Tasks.Task<Person> LoginAsync(LoginDTO loginDTO = default(LoginDTO), int operation |
| 0 | 621 | | { |
| 0 | 622 | | Applications.WeShare.Swagger.Client.ApiResponse<Person> localVarResponse = await LoginWithHttpInfoAsync(logi |
| 0 | 623 | | return localVarResponse.Data; |
| 0 | 624 | | } |
| | 625 | |
|
| | 626 | | /// <summary> |
| | 627 | | /// Login to WeShare |
| | 628 | | /// </summary> |
| | 629 | | /// <exception cref="Applications.WeShare.Swagger.Client.ApiException">Thrown when fails to make API call</excep |
| | 630 | | /// <param name="loginDTO"> (optional)</param> |
| | 631 | | /// <param name="operationIndex">Index associated with the operation.</param> |
| | 632 | | /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> |
| | 633 | | /// <returns>Task of ApiResponse (Person)</returns> |
| | 634 | | public async System.Threading.Tasks.Task<Applications.WeShare.Swagger.Client.ApiResponse<Person>> LoginWithHttpI |
| 0 | 635 | | { |
| | 636 | |
|
| 0 | 637 | | Applications.WeShare.Swagger.Client.RequestOptions localVarRequestOptions = new Applications.WeShare.Swagger |
| | 638 | |
|
| 0 | 639 | | string[] _contentTypes = new string[] { |
| 0 | 640 | | "application/json" |
| 0 | 641 | | }; |
| | 642 | |
|
| | 643 | | // to determine the Accept header |
| 0 | 644 | | string[] _accepts = new string[] { |
| 0 | 645 | | "application/json" |
| 0 | 646 | | }; |
| | 647 | |
|
| 0 | 648 | | var localVarContentType = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderContentType(_contentTy |
| 0 | 649 | | if (localVarContentType != null) |
| 0 | 650 | | { |
| 0 | 651 | | localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); |
| 0 | 652 | | } |
| | 653 | |
|
| 0 | 654 | | var localVarAccept = Applications.WeShare.Swagger.Client.ClientUtils.SelectHeaderAccept(_accepts); |
| 0 | 655 | | if (localVarAccept != null) |
| 0 | 656 | | { |
| 0 | 657 | | localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); |
| 0 | 658 | | } |
| | 659 | |
|
| 0 | 660 | | localVarRequestOptions.Data = loginDTO; |
| | 661 | |
|
| 0 | 662 | | localVarRequestOptions.Operation = "PeopleApi.Login"; |
| 0 | 663 | | localVarRequestOptions.OperationIndex = operationIndex; |
| | 664 | |
|
| | 665 | |
|
| | 666 | | // make the HTTP request |
| 0 | 667 | | var localVarResponse = await this.AsynchronousClient.PostAsync<Person>("/api/people", localVarRequestOptions |
| | 668 | |
|
| 0 | 669 | | if (this.ExceptionFactory != null) |
| 0 | 670 | | { |
| 0 | 671 | | Exception _exception = this.ExceptionFactory("Login", localVarResponse); |
| 0 | 672 | | if (_exception != null) |
| 0 | 673 | | { |
| 0 | 674 | | throw _exception; |
| | 675 | | } |
| 0 | 676 | | } |
| | 677 | |
|
| 0 | 678 | | return localVarResponse; |
| 0 | 679 | | } |
| | 680 | |
|
| | 681 | | } |
| | 682 | | } |