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