lusid-sdk 2.1.787__py3-none-any.whl → 2.1.789__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,701 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LUSID API
5
+
6
+ FINBOURNE Technology # noqa: E501
7
+
8
+ Contact: info@finbourne.com
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """
13
+
14
+
15
+ import re # noqa: F401
16
+ import io
17
+ import warnings
18
+
19
+ from pydantic.v1 import validate_arguments, ValidationError
20
+ from typing import overload, Optional, Union, Awaitable
21
+
22
+ from typing_extensions import Annotated
23
+ from datetime import datetime
24
+
25
+ from pydantic.v1 import Field, constr, validator
26
+
27
+ from typing import Optional
28
+
29
+ from lusid.models.deleted_entity_response import DeletedEntityResponse
30
+ from lusid.models.resource_list_of_returns_entity import ResourceListOfReturnsEntity
31
+ from lusid.models.returns_entity import ReturnsEntity
32
+
33
+ from lusid.api_client import ApiClient
34
+ from lusid.api_response import ApiResponse
35
+ from lusid.exceptions import ( # noqa: F401
36
+ ApiTypeError,
37
+ ApiValueError
38
+ )
39
+ from lusid.extensions.configuration_options import ConfigurationOptions
40
+
41
+ # ensure templated type usages are imported
42
+ from pydantic.v1 import Field, StrictStr
43
+ from typing import Optional
44
+ from typing_extensions import Annotated
45
+
46
+ class AggregatedReturnsApi:
47
+ """NOTE: This class is auto generated by OpenAPI Generator
48
+ Ref: https://openapi-generator.tech
49
+
50
+ Do not edit the class manually.
51
+ """
52
+
53
+ def __init__(self, api_client=None) -> None:
54
+ if api_client is None:
55
+ api_client = ApiClient.get_default()
56
+ self.api_client = api_client
57
+
58
+
59
+ @overload
60
+ async def delete_returns_entity(self, scope : Annotated[StrictStr, Field(..., description="Returns entity scope.")], code : Annotated[StrictStr, Field(..., description="Returns entity code.")], **kwargs) -> DeletedEntityResponse: # noqa: E501
61
+ ...
62
+
63
+ @overload
64
+ def delete_returns_entity(self, scope : Annotated[StrictStr, Field(..., description="Returns entity scope.")], code : Annotated[StrictStr, Field(..., description="Returns entity code.")], async_req: Optional[bool]=True, **kwargs) -> DeletedEntityResponse: # noqa: E501
65
+ ...
66
+
67
+ @validate_arguments
68
+ def delete_returns_entity(self, scope : Annotated[StrictStr, Field(..., description="Returns entity scope.")], code : Annotated[StrictStr, Field(..., description="Returns entity code.")], async_req: Optional[bool]=None, **kwargs) -> Union[DeletedEntityResponse, Awaitable[DeletedEntityResponse]]: # noqa: E501
69
+ """[EXPERIMENTAL] DeleteReturnsEntity: Delete returns entity. # noqa: E501
70
+
71
+ Delete returns entity. # noqa: E501
72
+ This method makes a synchronous HTTP request by default. To make an
73
+ asynchronous HTTP request, please pass async_req=True
74
+
75
+ >>> thread = api.delete_returns_entity(scope, code, async_req=True)
76
+ >>> result = thread.get()
77
+
78
+ :param scope: Returns entity scope. (required)
79
+ :type scope: str
80
+ :param code: Returns entity code. (required)
81
+ :type code: str
82
+ :param async_req: Whether to execute the request asynchronously.
83
+ :type async_req: bool, optional
84
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
85
+ :param opts: Configuration options for this request
86
+ :type opts: ConfigurationOptions, optional
87
+ :return: Returns the result object.
88
+ If the method is called asynchronously,
89
+ returns the request thread.
90
+ :rtype: DeletedEntityResponse
91
+ """
92
+ kwargs['_return_http_data_only'] = True
93
+ if '_preload_content' in kwargs:
94
+ message = "Error! Please call the delete_returns_entity_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
95
+ raise ValueError(message)
96
+ if async_req is not None:
97
+ kwargs['async_req'] = async_req
98
+ return self.delete_returns_entity_with_http_info(scope, code, **kwargs) # noqa: E501
99
+
100
+ @validate_arguments
101
+ def delete_returns_entity_with_http_info(self, scope : Annotated[StrictStr, Field(..., description="Returns entity scope.")], code : Annotated[StrictStr, Field(..., description="Returns entity code.")], **kwargs) -> ApiResponse: # noqa: E501
102
+ """[EXPERIMENTAL] DeleteReturnsEntity: Delete returns entity. # noqa: E501
103
+
104
+ Delete returns entity. # noqa: E501
105
+ This method makes a synchronous HTTP request by default. To make an
106
+ asynchronous HTTP request, please pass async_req=True
107
+
108
+ >>> thread = api.delete_returns_entity_with_http_info(scope, code, async_req=True)
109
+ >>> result = thread.get()
110
+
111
+ :param scope: Returns entity scope. (required)
112
+ :type scope: str
113
+ :param code: Returns entity code. (required)
114
+ :type code: str
115
+ :param async_req: Whether to execute the request asynchronously.
116
+ :type async_req: bool, optional
117
+ :param _preload_content: if False, the ApiResponse.data will
118
+ be set to none and raw_data will store the
119
+ HTTP response body without reading/decoding.
120
+ Default is True.
121
+ :type _preload_content: bool, optional
122
+ :param _return_http_data_only: response data instead of ApiResponse
123
+ object with status code, headers, etc
124
+ :type _return_http_data_only: bool, optional
125
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
126
+ :param opts: Configuration options for this request
127
+ :type opts: ConfigurationOptions, optional
128
+ :param _request_auth: set to override the auth_settings for an a single
129
+ request; this effectively ignores the authentication
130
+ in the spec for a single request.
131
+ :type _request_auth: dict, optional
132
+ :type _content_type: string, optional: force content-type for the request
133
+ :return: Returns the result object.
134
+ If the method is called asynchronously,
135
+ returns the request thread.
136
+ :rtype: tuple(DeletedEntityResponse, status_code(int), headers(HTTPHeaderDict))
137
+ """
138
+
139
+ _params = locals()
140
+
141
+ _all_params = [
142
+ 'scope',
143
+ 'code'
144
+ ]
145
+ _all_params.extend(
146
+ [
147
+ 'async_req',
148
+ '_return_http_data_only',
149
+ '_preload_content',
150
+ '_request_timeout',
151
+ '_request_auth',
152
+ '_content_type',
153
+ '_headers',
154
+ 'opts'
155
+ ]
156
+ )
157
+
158
+ # validate the arguments
159
+ for _key, _val in _params['kwargs'].items():
160
+ if _key not in _all_params:
161
+ raise ApiTypeError(
162
+ "Got an unexpected keyword argument '%s'"
163
+ " to method delete_returns_entity" % _key
164
+ )
165
+ _params[_key] = _val
166
+ del _params['kwargs']
167
+
168
+ _collection_formats = {}
169
+
170
+ # process the path parameters
171
+ _path_params = {}
172
+ if _params['scope']:
173
+ _path_params['scope'] = _params['scope']
174
+
175
+ if _params['code']:
176
+ _path_params['code'] = _params['code']
177
+
178
+
179
+ # process the query parameters
180
+ _query_params = []
181
+ # process the header parameters
182
+ _header_params = dict(_params.get('_headers', {}))
183
+ # process the form parameters
184
+ _form_params = []
185
+ _files = {}
186
+ # process the body parameter
187
+ _body_params = None
188
+ # set the HTTP header `Accept`
189
+ _header_params['Accept'] = self.api_client.select_header_accept(
190
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
191
+
192
+ # authentication setting
193
+ _auth_settings = ['oauth2'] # noqa: E501
194
+
195
+ _response_types_map = {
196
+ '200': "DeletedEntityResponse",
197
+ '400': "LusidValidationProblemDetails",
198
+ }
199
+
200
+ return self.api_client.call_api(
201
+ '/api/returns/{scope}/{code}', 'DELETE',
202
+ _path_params,
203
+ _query_params,
204
+ _header_params,
205
+ body=_body_params,
206
+ post_params=_form_params,
207
+ files=_files,
208
+ response_types_map=_response_types_map,
209
+ auth_settings=_auth_settings,
210
+ async_req=_params.get('async_req'),
211
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
212
+ _preload_content=_params.get('_preload_content', True),
213
+ _request_timeout=_params.get('_request_timeout'),
214
+ opts=_params.get('opts'),
215
+ collection_formats=_collection_formats,
216
+ _request_auth=_params.get('_request_auth'))
217
+
218
+
219
+ @overload
220
+ async def get_returns_entity(self, scope : Annotated[StrictStr, Field(..., description="Returns entity scope.")], code : Annotated[StrictStr, Field(..., description="Returns entity code.")], as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the returns entity. Defaults to return the latest version of the definition if not specified.")] = None, **kwargs) -> ReturnsEntity: # noqa: E501
221
+ ...
222
+
223
+ @overload
224
+ def get_returns_entity(self, scope : Annotated[StrictStr, Field(..., description="Returns entity scope.")], code : Annotated[StrictStr, Field(..., description="Returns entity code.")], as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the returns entity. Defaults to return the latest version of the definition if not specified.")] = None, async_req: Optional[bool]=True, **kwargs) -> ReturnsEntity: # noqa: E501
225
+ ...
226
+
227
+ @validate_arguments
228
+ def get_returns_entity(self, scope : Annotated[StrictStr, Field(..., description="Returns entity scope.")], code : Annotated[StrictStr, Field(..., description="Returns entity code.")], as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the returns entity. Defaults to return the latest version of the definition if not specified.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ReturnsEntity, Awaitable[ReturnsEntity]]: # noqa: E501
229
+ """[EXPERIMENTAL] GetReturnsEntity: Get returns entity. # noqa: E501
230
+
231
+ Get returns entity. # noqa: E501
232
+ This method makes a synchronous HTTP request by default. To make an
233
+ asynchronous HTTP request, please pass async_req=True
234
+
235
+ >>> thread = api.get_returns_entity(scope, code, as_at, async_req=True)
236
+ >>> result = thread.get()
237
+
238
+ :param scope: Returns entity scope. (required)
239
+ :type scope: str
240
+ :param code: Returns entity code. (required)
241
+ :type code: str
242
+ :param as_at: The asAt datetime at which to retrieve the returns entity. Defaults to return the latest version of the definition if not specified.
243
+ :type as_at: datetime
244
+ :param async_req: Whether to execute the request asynchronously.
245
+ :type async_req: bool, optional
246
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
247
+ :param opts: Configuration options for this request
248
+ :type opts: ConfigurationOptions, optional
249
+ :return: Returns the result object.
250
+ If the method is called asynchronously,
251
+ returns the request thread.
252
+ :rtype: ReturnsEntity
253
+ """
254
+ kwargs['_return_http_data_only'] = True
255
+ if '_preload_content' in kwargs:
256
+ message = "Error! Please call the get_returns_entity_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
257
+ raise ValueError(message)
258
+ if async_req is not None:
259
+ kwargs['async_req'] = async_req
260
+ return self.get_returns_entity_with_http_info(scope, code, as_at, **kwargs) # noqa: E501
261
+
262
+ @validate_arguments
263
+ def get_returns_entity_with_http_info(self, scope : Annotated[StrictStr, Field(..., description="Returns entity scope.")], code : Annotated[StrictStr, Field(..., description="Returns entity code.")], as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the returns entity. Defaults to return the latest version of the definition if not specified.")] = None, **kwargs) -> ApiResponse: # noqa: E501
264
+ """[EXPERIMENTAL] GetReturnsEntity: Get returns entity. # noqa: E501
265
+
266
+ Get returns entity. # noqa: E501
267
+ This method makes a synchronous HTTP request by default. To make an
268
+ asynchronous HTTP request, please pass async_req=True
269
+
270
+ >>> thread = api.get_returns_entity_with_http_info(scope, code, as_at, async_req=True)
271
+ >>> result = thread.get()
272
+
273
+ :param scope: Returns entity scope. (required)
274
+ :type scope: str
275
+ :param code: Returns entity code. (required)
276
+ :type code: str
277
+ :param as_at: The asAt datetime at which to retrieve the returns entity. Defaults to return the latest version of the definition if not specified.
278
+ :type as_at: datetime
279
+ :param async_req: Whether to execute the request asynchronously.
280
+ :type async_req: bool, optional
281
+ :param _preload_content: if False, the ApiResponse.data will
282
+ be set to none and raw_data will store the
283
+ HTTP response body without reading/decoding.
284
+ Default is True.
285
+ :type _preload_content: bool, optional
286
+ :param _return_http_data_only: response data instead of ApiResponse
287
+ object with status code, headers, etc
288
+ :type _return_http_data_only: bool, optional
289
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
290
+ :param opts: Configuration options for this request
291
+ :type opts: ConfigurationOptions, optional
292
+ :param _request_auth: set to override the auth_settings for an a single
293
+ request; this effectively ignores the authentication
294
+ in the spec for a single request.
295
+ :type _request_auth: dict, optional
296
+ :type _content_type: string, optional: force content-type for the request
297
+ :return: Returns the result object.
298
+ If the method is called asynchronously,
299
+ returns the request thread.
300
+ :rtype: tuple(ReturnsEntity, status_code(int), headers(HTTPHeaderDict))
301
+ """
302
+
303
+ _params = locals()
304
+
305
+ _all_params = [
306
+ 'scope',
307
+ 'code',
308
+ 'as_at'
309
+ ]
310
+ _all_params.extend(
311
+ [
312
+ 'async_req',
313
+ '_return_http_data_only',
314
+ '_preload_content',
315
+ '_request_timeout',
316
+ '_request_auth',
317
+ '_content_type',
318
+ '_headers',
319
+ 'opts'
320
+ ]
321
+ )
322
+
323
+ # validate the arguments
324
+ for _key, _val in _params['kwargs'].items():
325
+ if _key not in _all_params:
326
+ raise ApiTypeError(
327
+ "Got an unexpected keyword argument '%s'"
328
+ " to method get_returns_entity" % _key
329
+ )
330
+ _params[_key] = _val
331
+ del _params['kwargs']
332
+
333
+ _collection_formats = {}
334
+
335
+ # process the path parameters
336
+ _path_params = {}
337
+ if _params['scope']:
338
+ _path_params['scope'] = _params['scope']
339
+
340
+ if _params['code']:
341
+ _path_params['code'] = _params['code']
342
+
343
+
344
+ # process the query parameters
345
+ _query_params = []
346
+ if _params.get('as_at') is not None: # noqa: E501
347
+ if isinstance(_params['as_at'], datetime):
348
+ _query_params.append(('asAt', _params['as_at'].strftime(self.api_client.configuration.datetime_format)))
349
+ else:
350
+ _query_params.append(('asAt', _params['as_at']))
351
+
352
+ # process the header parameters
353
+ _header_params = dict(_params.get('_headers', {}))
354
+ # process the form parameters
355
+ _form_params = []
356
+ _files = {}
357
+ # process the body parameter
358
+ _body_params = None
359
+ # set the HTTP header `Accept`
360
+ _header_params['Accept'] = self.api_client.select_header_accept(
361
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
362
+
363
+ # authentication setting
364
+ _auth_settings = ['oauth2'] # noqa: E501
365
+
366
+ _response_types_map = {
367
+ '200': "ReturnsEntity",
368
+ '400': "LusidValidationProblemDetails",
369
+ }
370
+
371
+ return self.api_client.call_api(
372
+ '/api/returns/{scope}/{code}', 'GET',
373
+ _path_params,
374
+ _query_params,
375
+ _header_params,
376
+ body=_body_params,
377
+ post_params=_form_params,
378
+ files=_files,
379
+ response_types_map=_response_types_map,
380
+ auth_settings=_auth_settings,
381
+ async_req=_params.get('async_req'),
382
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
383
+ _preload_content=_params.get('_preload_content', True),
384
+ _request_timeout=_params.get('_request_timeout'),
385
+ opts=_params.get('opts'),
386
+ collection_formats=_collection_formats,
387
+ _request_auth=_params.get('_request_auth'))
388
+
389
+
390
+ @overload
391
+ async def list_returns_entities(self, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the relation definitions. Defaults to return the latest version of each definition if not specified.")] = None, **kwargs) -> ResourceListOfReturnsEntity: # noqa: E501
392
+ ...
393
+
394
+ @overload
395
+ def list_returns_entities(self, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the relation definitions. Defaults to return the latest version of each definition if not specified.")] = None, async_req: Optional[bool]=True, **kwargs) -> ResourceListOfReturnsEntity: # noqa: E501
396
+ ...
397
+
398
+ @validate_arguments
399
+ def list_returns_entities(self, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the relation definitions. Defaults to return the latest version of each definition if not specified.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ResourceListOfReturnsEntity, Awaitable[ResourceListOfReturnsEntity]]: # noqa: E501
400
+ """[EXPERIMENTAL] ListReturnsEntities: List returns entities. # noqa: E501
401
+
402
+ List returns entities. # noqa: E501
403
+ This method makes a synchronous HTTP request by default. To make an
404
+ asynchronous HTTP request, please pass async_req=True
405
+
406
+ >>> thread = api.list_returns_entities(as_at, async_req=True)
407
+ >>> result = thread.get()
408
+
409
+ :param as_at: The asAt datetime at which to retrieve the relation definitions. Defaults to return the latest version of each definition if not specified.
410
+ :type as_at: datetime
411
+ :param async_req: Whether to execute the request asynchronously.
412
+ :type async_req: bool, optional
413
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
414
+ :param opts: Configuration options for this request
415
+ :type opts: ConfigurationOptions, optional
416
+ :return: Returns the result object.
417
+ If the method is called asynchronously,
418
+ returns the request thread.
419
+ :rtype: ResourceListOfReturnsEntity
420
+ """
421
+ kwargs['_return_http_data_only'] = True
422
+ if '_preload_content' in kwargs:
423
+ message = "Error! Please call the list_returns_entities_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
424
+ raise ValueError(message)
425
+ if async_req is not None:
426
+ kwargs['async_req'] = async_req
427
+ return self.list_returns_entities_with_http_info(as_at, **kwargs) # noqa: E501
428
+
429
+ @validate_arguments
430
+ def list_returns_entities_with_http_info(self, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the relation definitions. Defaults to return the latest version of each definition if not specified.")] = None, **kwargs) -> ApiResponse: # noqa: E501
431
+ """[EXPERIMENTAL] ListReturnsEntities: List returns entities. # noqa: E501
432
+
433
+ List returns entities. # noqa: E501
434
+ This method makes a synchronous HTTP request by default. To make an
435
+ asynchronous HTTP request, please pass async_req=True
436
+
437
+ >>> thread = api.list_returns_entities_with_http_info(as_at, async_req=True)
438
+ >>> result = thread.get()
439
+
440
+ :param as_at: The asAt datetime at which to retrieve the relation definitions. Defaults to return the latest version of each definition if not specified.
441
+ :type as_at: datetime
442
+ :param async_req: Whether to execute the request asynchronously.
443
+ :type async_req: bool, optional
444
+ :param _preload_content: if False, the ApiResponse.data will
445
+ be set to none and raw_data will store the
446
+ HTTP response body without reading/decoding.
447
+ Default is True.
448
+ :type _preload_content: bool, optional
449
+ :param _return_http_data_only: response data instead of ApiResponse
450
+ object with status code, headers, etc
451
+ :type _return_http_data_only: bool, optional
452
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
453
+ :param opts: Configuration options for this request
454
+ :type opts: ConfigurationOptions, optional
455
+ :param _request_auth: set to override the auth_settings for an a single
456
+ request; this effectively ignores the authentication
457
+ in the spec for a single request.
458
+ :type _request_auth: dict, optional
459
+ :type _content_type: string, optional: force content-type for the request
460
+ :return: Returns the result object.
461
+ If the method is called asynchronously,
462
+ returns the request thread.
463
+ :rtype: tuple(ResourceListOfReturnsEntity, status_code(int), headers(HTTPHeaderDict))
464
+ """
465
+
466
+ _params = locals()
467
+
468
+ _all_params = [
469
+ 'as_at'
470
+ ]
471
+ _all_params.extend(
472
+ [
473
+ 'async_req',
474
+ '_return_http_data_only',
475
+ '_preload_content',
476
+ '_request_timeout',
477
+ '_request_auth',
478
+ '_content_type',
479
+ '_headers',
480
+ 'opts'
481
+ ]
482
+ )
483
+
484
+ # validate the arguments
485
+ for _key, _val in _params['kwargs'].items():
486
+ if _key not in _all_params:
487
+ raise ApiTypeError(
488
+ "Got an unexpected keyword argument '%s'"
489
+ " to method list_returns_entities" % _key
490
+ )
491
+ _params[_key] = _val
492
+ del _params['kwargs']
493
+
494
+ _collection_formats = {}
495
+
496
+ # process the path parameters
497
+ _path_params = {}
498
+
499
+ # process the query parameters
500
+ _query_params = []
501
+ if _params.get('as_at') is not None: # noqa: E501
502
+ if isinstance(_params['as_at'], datetime):
503
+ _query_params.append(('asAt', _params['as_at'].strftime(self.api_client.configuration.datetime_format)))
504
+ else:
505
+ _query_params.append(('asAt', _params['as_at']))
506
+
507
+ # process the header parameters
508
+ _header_params = dict(_params.get('_headers', {}))
509
+ # process the form parameters
510
+ _form_params = []
511
+ _files = {}
512
+ # process the body parameter
513
+ _body_params = None
514
+ # set the HTTP header `Accept`
515
+ _header_params['Accept'] = self.api_client.select_header_accept(
516
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
517
+
518
+ # authentication setting
519
+ _auth_settings = ['oauth2'] # noqa: E501
520
+
521
+ _response_types_map = {
522
+ '200': "ResourceListOfReturnsEntity",
523
+ '400': "LusidValidationProblemDetails",
524
+ }
525
+
526
+ return self.api_client.call_api(
527
+ '/api/returns', 'GET',
528
+ _path_params,
529
+ _query_params,
530
+ _header_params,
531
+ body=_body_params,
532
+ post_params=_form_params,
533
+ files=_files,
534
+ response_types_map=_response_types_map,
535
+ auth_settings=_auth_settings,
536
+ async_req=_params.get('async_req'),
537
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
538
+ _preload_content=_params.get('_preload_content', True),
539
+ _request_timeout=_params.get('_request_timeout'),
540
+ opts=_params.get('opts'),
541
+ collection_formats=_collection_formats,
542
+ _request_auth=_params.get('_request_auth'))
543
+
544
+
545
+ @overload
546
+ async def upsert_returns_entity(self, returns_entity : Annotated[ReturnsEntity, Field(..., description="Definition of the returns entity.")], **kwargs) -> ReturnsEntity: # noqa: E501
547
+ ...
548
+
549
+ @overload
550
+ def upsert_returns_entity(self, returns_entity : Annotated[ReturnsEntity, Field(..., description="Definition of the returns entity.")], async_req: Optional[bool]=True, **kwargs) -> ReturnsEntity: # noqa: E501
551
+ ...
552
+
553
+ @validate_arguments
554
+ def upsert_returns_entity(self, returns_entity : Annotated[ReturnsEntity, Field(..., description="Definition of the returns entity.")], async_req: Optional[bool]=None, **kwargs) -> Union[ReturnsEntity, Awaitable[ReturnsEntity]]: # noqa: E501
555
+ """[EXPERIMENTAL] UpsertReturnsEntity: Upsert returns entity. # noqa: E501
556
+
557
+ Upsert returns entity. # noqa: E501
558
+ This method makes a synchronous HTTP request by default. To make an
559
+ asynchronous HTTP request, please pass async_req=True
560
+
561
+ >>> thread = api.upsert_returns_entity(returns_entity, async_req=True)
562
+ >>> result = thread.get()
563
+
564
+ :param returns_entity: Definition of the returns entity. (required)
565
+ :type returns_entity: ReturnsEntity
566
+ :param async_req: Whether to execute the request asynchronously.
567
+ :type async_req: bool, optional
568
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
569
+ :param opts: Configuration options for this request
570
+ :type opts: ConfigurationOptions, optional
571
+ :return: Returns the result object.
572
+ If the method is called asynchronously,
573
+ returns the request thread.
574
+ :rtype: ReturnsEntity
575
+ """
576
+ kwargs['_return_http_data_only'] = True
577
+ if '_preload_content' in kwargs:
578
+ message = "Error! Please call the upsert_returns_entity_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
579
+ raise ValueError(message)
580
+ if async_req is not None:
581
+ kwargs['async_req'] = async_req
582
+ return self.upsert_returns_entity_with_http_info(returns_entity, **kwargs) # noqa: E501
583
+
584
+ @validate_arguments
585
+ def upsert_returns_entity_with_http_info(self, returns_entity : Annotated[ReturnsEntity, Field(..., description="Definition of the returns entity.")], **kwargs) -> ApiResponse: # noqa: E501
586
+ """[EXPERIMENTAL] UpsertReturnsEntity: Upsert returns entity. # noqa: E501
587
+
588
+ Upsert returns entity. # noqa: E501
589
+ This method makes a synchronous HTTP request by default. To make an
590
+ asynchronous HTTP request, please pass async_req=True
591
+
592
+ >>> thread = api.upsert_returns_entity_with_http_info(returns_entity, async_req=True)
593
+ >>> result = thread.get()
594
+
595
+ :param returns_entity: Definition of the returns entity. (required)
596
+ :type returns_entity: ReturnsEntity
597
+ :param async_req: Whether to execute the request asynchronously.
598
+ :type async_req: bool, optional
599
+ :param _preload_content: if False, the ApiResponse.data will
600
+ be set to none and raw_data will store the
601
+ HTTP response body without reading/decoding.
602
+ Default is True.
603
+ :type _preload_content: bool, optional
604
+ :param _return_http_data_only: response data instead of ApiResponse
605
+ object with status code, headers, etc
606
+ :type _return_http_data_only: bool, optional
607
+ :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
608
+ :param opts: Configuration options for this request
609
+ :type opts: ConfigurationOptions, optional
610
+ :param _request_auth: set to override the auth_settings for an a single
611
+ request; this effectively ignores the authentication
612
+ in the spec for a single request.
613
+ :type _request_auth: dict, optional
614
+ :type _content_type: string, optional: force content-type for the request
615
+ :return: Returns the result object.
616
+ If the method is called asynchronously,
617
+ returns the request thread.
618
+ :rtype: tuple(ReturnsEntity, status_code(int), headers(HTTPHeaderDict))
619
+ """
620
+
621
+ _params = locals()
622
+
623
+ _all_params = [
624
+ 'returns_entity'
625
+ ]
626
+ _all_params.extend(
627
+ [
628
+ 'async_req',
629
+ '_return_http_data_only',
630
+ '_preload_content',
631
+ '_request_timeout',
632
+ '_request_auth',
633
+ '_content_type',
634
+ '_headers',
635
+ 'opts'
636
+ ]
637
+ )
638
+
639
+ # validate the arguments
640
+ for _key, _val in _params['kwargs'].items():
641
+ if _key not in _all_params:
642
+ raise ApiTypeError(
643
+ "Got an unexpected keyword argument '%s'"
644
+ " to method upsert_returns_entity" % _key
645
+ )
646
+ _params[_key] = _val
647
+ del _params['kwargs']
648
+
649
+ _collection_formats = {}
650
+
651
+ # process the path parameters
652
+ _path_params = {}
653
+
654
+ # process the query parameters
655
+ _query_params = []
656
+ # process the header parameters
657
+ _header_params = dict(_params.get('_headers', {}))
658
+ # process the form parameters
659
+ _form_params = []
660
+ _files = {}
661
+ # process the body parameter
662
+ _body_params = None
663
+ if _params['returns_entity'] is not None:
664
+ _body_params = _params['returns_entity']
665
+
666
+ # set the HTTP header `Accept`
667
+ _header_params['Accept'] = self.api_client.select_header_accept(
668
+ ['text/plain', 'application/json', 'text/json']) # noqa: E501
669
+
670
+ # set the HTTP header `Content-Type`
671
+ _content_types_list = _params.get('_content_type',
672
+ self.api_client.select_header_content_type(
673
+ ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']))
674
+ if _content_types_list:
675
+ _header_params['Content-Type'] = _content_types_list
676
+
677
+ # authentication setting
678
+ _auth_settings = ['oauth2'] # noqa: E501
679
+
680
+ _response_types_map = {
681
+ '201': "ReturnsEntity",
682
+ '400': "LusidValidationProblemDetails",
683
+ }
684
+
685
+ return self.api_client.call_api(
686
+ '/api/returns', 'POST',
687
+ _path_params,
688
+ _query_params,
689
+ _header_params,
690
+ body=_body_params,
691
+ post_params=_form_params,
692
+ files=_files,
693
+ response_types_map=_response_types_map,
694
+ auth_settings=_auth_settings,
695
+ async_req=_params.get('async_req'),
696
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
697
+ _preload_content=_params.get('_preload_content', True),
698
+ _request_timeout=_params.get('_request_timeout'),
699
+ opts=_params.get('opts'),
700
+ collection_formats=_collection_formats,
701
+ _request_auth=_params.get('_request_auth'))