Source code for sdk.lusid.api.legacy_compliance_api

# coding: utf-8

"""
    LUSID API

    FINBOURNE Technology  # noqa: E501

    Contact: info@finbourne.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""


import re  # noqa: F401
import io
import warnings

from pydantic.v1 import validate_arguments, ValidationError
from typing import overload, Optional, Union, Awaitable

from typing_extensions import Annotated
from datetime import datetime

from pydantic.v1 import Field, StrictBool, StrictStr, conint, constr, validator

from typing import Dict, Optional

from lusid.models.compliance_rule import ComplianceRule
from lusid.models.compliance_rule_upsert_request import ComplianceRuleUpsertRequest
from lusid.models.compliance_rule_upsert_response import ComplianceRuleUpsertResponse
from lusid.models.compliance_run_info import ComplianceRunInfo
from lusid.models.deleted_entity_response import DeletedEntityResponse
from lusid.models.resource_list_of_compliance_breached_order_info import ResourceListOfComplianceBreachedOrderInfo
from lusid.models.resource_list_of_compliance_rule import ResourceListOfComplianceRule
from lusid.models.resource_list_of_compliance_rule_result import ResourceListOfComplianceRuleResult
from lusid.models.resource_list_of_compliance_run_info import ResourceListOfComplianceRunInfo

from lusid.api_client import ApiClient
from lusid.api_response import ApiResponse
from lusid.exceptions import (  # noqa: F401
    ApiTypeError,
    ApiValueError
)


[docs] class LegacyComplianceApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @overload async def delete_legacy_compliance_rule(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule scope.")], code : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule code.")], **kwargs) -> DeletedEntityResponse: # noqa: E501 ... @overload def delete_legacy_compliance_rule(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule scope.")], code : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule code.")], async_req: Optional[bool]=True, **kwargs) -> DeletedEntityResponse: # noqa: E501 ...
[docs] @validate_arguments def delete_legacy_compliance_rule(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule scope.")], code : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule code.")], async_req: Optional[bool]=None, **kwargs) -> Union[DeletedEntityResponse, Awaitable[DeletedEntityResponse]]: # noqa: E501 """[EXPERIMENTAL] DeleteLegacyComplianceRule: Deletes a compliance rule. # noqa: E501 Deletes the rule for all effective time. The rule will remain viewable at previous as at times, and as part of the results of compliance runs, but it will no longer be considered in new compliance runs. This cannot be undone. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_legacy_compliance_rule(scope, code, async_req=True) >>> result = thread.get() :param scope: The compliance rule scope. (required) :type scope: str :param code: The compliance rule code. (required) :type code: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: DeletedEntityResponse """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: message = "Error! Please call the delete_legacy_compliance_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.delete_legacy_compliance_rule_with_http_info(scope, code, **kwargs) # noqa: E501
[docs] @validate_arguments def delete_legacy_compliance_rule_with_http_info(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule scope.")], code : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule code.")], **kwargs) -> ApiResponse: # noqa: E501 """[EXPERIMENTAL] DeleteLegacyComplianceRule: Deletes a compliance rule. # noqa: E501 Deletes the rule for all effective time. The rule will remain viewable at previous as at times, and as part of the results of compliance runs, but it will no longer be considered in new compliance runs. This cannot be undone. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_legacy_compliance_rule_with_http_info(scope, code, async_req=True) >>> result = thread.get() :param scope: The compliance rule scope. (required) :type scope: str :param code: The compliance rule code. (required) :type code: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional :param _return_http_data_only: response data instead of ApiResponse object with status code, headers, etc :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(DeletedEntityResponse, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ 'scope', 'code' ] _all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) # validate the arguments for _key, _val in _params['kwargs'].items(): if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_legacy_compliance_rule" % _key ) _params[_key] = _val del _params['kwargs'] _collection_formats = {} # process the path parameters _path_params = {} if _params['scope']: _path_params['scope'] = _params['scope'] if _params['code']: _path_params['code'] = _params['code'] # process the query parameters _query_params = [] # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters _form_params = [] _files = {} # process the body parameter _body_params = None # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # authentication setting _auth_settings = ['oauth2'] # noqa: E501 _response_types_map = { '200': "DeletedEntityResponse", '400': "LusidValidationProblemDetails", } return self.api_client.call_api( '/api/legacy/compliance/rules/{scope}/{code}', 'DELETE', _path_params, _query_params, _header_params, body=_body_params, post_params=_form_params, files=_files, response_types_map=_response_types_map, auth_settings=_auth_settings, async_req=_params.get('async_req'), _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 _preload_content=_params.get('_preload_content', True), _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth'))
@overload async def get_legacy_breached_orders_info(self, run_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The RunId that the results should be checked for")], order_scope : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional. Find rules related to a specific order by providing an Order Scope/Code combination")] = None, order_code : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional. Find rules related to a specific order by providing an Order Scope/Code combination")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, **kwargs) -> ResourceListOfComplianceBreachedOrderInfo: # noqa: E501 ... @overload def get_legacy_breached_orders_info(self, run_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The RunId that the results should be checked for")], order_scope : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional. Find rules related to a specific order by providing an Order Scope/Code combination")] = None, order_code : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional. Find rules related to a specific order by providing an Order Scope/Code combination")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, async_req: Optional[bool]=True, **kwargs) -> ResourceListOfComplianceBreachedOrderInfo: # noqa: E501 ...
[docs] @validate_arguments def get_legacy_breached_orders_info(self, run_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The RunId that the results should be checked for")], order_scope : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional. Find rules related to a specific order by providing an Order Scope/Code combination")] = None, order_code : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional. Find rules related to a specific order by providing an Order Scope/Code combination")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ResourceListOfComplianceBreachedOrderInfo, Awaitable[ResourceListOfComplianceBreachedOrderInfo]]: # noqa: E501 """[EXPERIMENTAL] GetLegacyBreachedOrdersInfo: Get the Ids of Breached orders in a given compliance run and the corresponding list of rules that could have caused it. # noqa: E501 Use this endpoint to get a list or breached orders and the set of rules that may have caused the breach. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_legacy_breached_orders_info(run_id, order_scope, order_code, limit, async_req=True) >>> result = thread.get() :param run_id: The RunId that the results should be checked for (required) :type run_id: str :param order_scope: Optional. Find rules related to a specific order by providing an Order Scope/Code combination :type order_scope: str :param order_code: Optional. Find rules related to a specific order by providing an Order Scope/Code combination :type order_code: str :param limit: When paginating, limit the number of returned results to this many. :type limit: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: ResourceListOfComplianceBreachedOrderInfo """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: message = "Error! Please call the get_legacy_breached_orders_info_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.get_legacy_breached_orders_info_with_http_info(run_id, order_scope, order_code, limit, **kwargs) # noqa: E501
[docs] @validate_arguments def get_legacy_breached_orders_info_with_http_info(self, run_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The RunId that the results should be checked for")], order_scope : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional. Find rules related to a specific order by providing an Order Scope/Code combination")] = None, order_code : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional. Find rules related to a specific order by providing an Order Scope/Code combination")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """[EXPERIMENTAL] GetLegacyBreachedOrdersInfo: Get the Ids of Breached orders in a given compliance run and the corresponding list of rules that could have caused it. # noqa: E501 Use this endpoint to get a list or breached orders and the set of rules that may have caused the breach. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_legacy_breached_orders_info_with_http_info(run_id, order_scope, order_code, limit, async_req=True) >>> result = thread.get() :param run_id: The RunId that the results should be checked for (required) :type run_id: str :param order_scope: Optional. Find rules related to a specific order by providing an Order Scope/Code combination :type order_scope: str :param order_code: Optional. Find rules related to a specific order by providing an Order Scope/Code combination :type order_code: str :param limit: When paginating, limit the number of returned results to this many. :type limit: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional :param _return_http_data_only: response data instead of ApiResponse object with status code, headers, etc :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(ResourceListOfComplianceBreachedOrderInfo, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ 'run_id', 'order_scope', 'order_code', 'limit' ] _all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) # validate the arguments for _key, _val in _params['kwargs'].items(): if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_legacy_breached_orders_info" % _key ) _params[_key] = _val del _params['kwargs'] _collection_formats = {} # process the path parameters _path_params = {} if _params['run_id']: _path_params['runId'] = _params['run_id'] # process the query parameters _query_params = [] if _params.get('order_scope') is not None: # noqa: E501 _query_params.append(('orderScope', _params['order_scope'])) if _params.get('order_code') is not None: # noqa: E501 _query_params.append(('orderCode', _params['order_code'])) if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters _form_params = [] _files = {} # process the body parameter _body_params = None # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # authentication setting _auth_settings = ['oauth2'] # noqa: E501 _response_types_map = { '200': "ResourceListOfComplianceBreachedOrderInfo", '400': "LusidValidationProblemDetails", } return self.api_client.call_api( '/api/legacy/compliance/runs/breached/{runId}', 'GET', _path_params, _query_params, _header_params, body=_body_params, post_params=_form_params, files=_files, response_types_map=_response_types_map, auth_settings=_auth_settings, async_req=_params.get('async_req'), _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 _preload_content=_params.get('_preload_content', True), _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth'))
@overload async def get_legacy_compliance_rule(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule scope.")], code : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule code.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the rule definition. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the rule definition. Defaults to returning the latest version if not specified.")] = None, **kwargs) -> ComplianceRule: # noqa: E501 ... @overload def get_legacy_compliance_rule(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule scope.")], code : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule code.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the rule definition. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the rule definition. Defaults to returning the latest version if not specified.")] = None, async_req: Optional[bool]=True, **kwargs) -> ComplianceRule: # noqa: E501 ...
[docs] @validate_arguments def get_legacy_compliance_rule(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule scope.")], code : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule code.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the rule definition. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the rule definition. Defaults to returning the latest version if not specified.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ComplianceRule, Awaitable[ComplianceRule]]: # noqa: E501 """[EXPERIMENTAL] GetLegacyComplianceRule: Retrieve the definition of single compliance rule. # noqa: E501 Retrieves the compliance rule definition at the given effective and as at times. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_legacy_compliance_rule(scope, code, effective_at, as_at, async_req=True) >>> result = thread.get() :param scope: The compliance rule scope. (required) :type scope: str :param code: The compliance rule code. (required) :type code: str :param effective_at: The effective datetime or cut label at which to retrieve the rule definition. Defaults to the current LUSID system datetime if not specified. :type effective_at: str :param as_at: The asAt datetime at which to retrieve the rule definition. Defaults to returning the latest version if not specified. :type as_at: datetime :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: ComplianceRule """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: message = "Error! Please call the get_legacy_compliance_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.get_legacy_compliance_rule_with_http_info(scope, code, effective_at, as_at, **kwargs) # noqa: E501
[docs] @validate_arguments def get_legacy_compliance_rule_with_http_info(self, scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule scope.")], code : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The compliance rule code.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the rule definition. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the rule definition. Defaults to returning the latest version if not specified.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """[EXPERIMENTAL] GetLegacyComplianceRule: Retrieve the definition of single compliance rule. # noqa: E501 Retrieves the compliance rule definition at the given effective and as at times. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_legacy_compliance_rule_with_http_info(scope, code, effective_at, as_at, async_req=True) >>> result = thread.get() :param scope: The compliance rule scope. (required) :type scope: str :param code: The compliance rule code. (required) :type code: str :param effective_at: The effective datetime or cut label at which to retrieve the rule definition. Defaults to the current LUSID system datetime if not specified. :type effective_at: str :param as_at: The asAt datetime at which to retrieve the rule definition. Defaults to returning the latest version if not specified. :type as_at: datetime :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional :param _return_http_data_only: response data instead of ApiResponse object with status code, headers, etc :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(ComplianceRule, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ 'scope', 'code', 'effective_at', 'as_at' ] _all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) # validate the arguments for _key, _val in _params['kwargs'].items(): if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_legacy_compliance_rule" % _key ) _params[_key] = _val del _params['kwargs'] _collection_formats = {} # process the path parameters _path_params = {} if _params['scope']: _path_params['scope'] = _params['scope'] if _params['code']: _path_params['code'] = _params['code'] # process the query parameters _query_params = [] if _params.get('effective_at') is not None: # noqa: E501 _query_params.append(('effectiveAt', _params['effective_at'])) if _params.get('as_at') is not None: # noqa: E501 if isinstance(_params['as_at'], datetime): _query_params.append(('asAt', _params['as_at'].strftime(self.api_client.configuration.datetime_format))) else: _query_params.append(('asAt', _params['as_at'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters _form_params = [] _files = {} # process the body parameter _body_params = None # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # authentication setting _auth_settings = ['oauth2'] # noqa: E501 _response_types_map = { '200': "ComplianceRule", '400': "LusidValidationProblemDetails", } return self.api_client.call_api( '/api/legacy/compliance/rules/{scope}/{code}', 'GET', _path_params, _query_params, _header_params, body=_body_params, post_params=_form_params, files=_files, response_types_map=_response_types_map, auth_settings=_auth_settings, async_req=_params.get('async_req'), _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 _preload_content=_params.get('_preload_content', True), _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth'))
@overload async def get_legacy_compliance_run_results(self, run_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The unique identifier of the compliance run requested.")], page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing compliance rule results from a previous call to list compliance rule result. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid.")] = None, **kwargs) -> ResourceListOfComplianceRuleResult: # noqa: E501 ... @overload def get_legacy_compliance_run_results(self, run_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The unique identifier of the compliance run requested.")], page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing compliance rule results from a previous call to list compliance rule result. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid.")] = None, async_req: Optional[bool]=True, **kwargs) -> ResourceListOfComplianceRuleResult: # noqa: E501 ...
[docs] @validate_arguments def get_legacy_compliance_run_results(self, run_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The unique identifier of the compliance run requested.")], page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing compliance rule results from a previous call to list compliance rule result. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ResourceListOfComplianceRuleResult, Awaitable[ResourceListOfComplianceRuleResult]]: # noqa: E501 """[EXPERIMENTAL] GetLegacyComplianceRunResults: Get the details of a single compliance run. # noqa: E501 Use this endpoint to fetch the detail associated with a specific compliance run, including a breakdown of the passing state of each rule, portfolio combination. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_legacy_compliance_run_results(run_id, page, limit, filter, async_req=True) >>> result = thread.get() :param run_id: The unique identifier of the compliance run requested. (required) :type run_id: str :param page: The pagination token to use to continue listing compliance rule results from a previous call to list compliance rule result. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request. :type page: str :param limit: When paginating, limit the number of returned results to this many. :type limit: int :param filter: Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid. :type filter: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: ResourceListOfComplianceRuleResult """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: message = "Error! Please call the get_legacy_compliance_run_results_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.get_legacy_compliance_run_results_with_http_info(run_id, page, limit, filter, **kwargs) # noqa: E501
[docs] @validate_arguments def get_legacy_compliance_run_results_with_http_info(self, run_id : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="The unique identifier of the compliance run requested.")], page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing compliance rule results from a previous call to list compliance rule result. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """[EXPERIMENTAL] GetLegacyComplianceRunResults: Get the details of a single compliance run. # noqa: E501 Use this endpoint to fetch the detail associated with a specific compliance run, including a breakdown of the passing state of each rule, portfolio combination. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_legacy_compliance_run_results_with_http_info(run_id, page, limit, filter, async_req=True) >>> result = thread.get() :param run_id: The unique identifier of the compliance run requested. (required) :type run_id: str :param page: The pagination token to use to continue listing compliance rule results from a previous call to list compliance rule result. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request. :type page: str :param limit: When paginating, limit the number of returned results to this many. :type limit: int :param filter: Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid. :type filter: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional :param _return_http_data_only: response data instead of ApiResponse object with status code, headers, etc :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(ResourceListOfComplianceRuleResult, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ 'run_id', 'page', 'limit', 'filter' ] _all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) # validate the arguments for _key, _val in _params['kwargs'].items(): if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_legacy_compliance_run_results" % _key ) _params[_key] = _val del _params['kwargs'] _collection_formats = {} # process the path parameters _path_params = {} if _params['run_id']: _path_params['runId'] = _params['run_id'] # process the query parameters _query_params = [] if _params.get('page') is not None: # noqa: E501 _query_params.append(('page', _params['page'])) if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) if _params.get('filter') is not None: # noqa: E501 _query_params.append(('filter', _params['filter'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters _form_params = [] _files = {} # process the body parameter _body_params = None # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # authentication setting _auth_settings = ['oauth2'] # noqa: E501 _response_types_map = { '200': "ResourceListOfComplianceRuleResult", '400': "LusidValidationProblemDetails", } return self.api_client.call_api( '/api/legacy/compliance/runs/{runId}', 'GET', _path_params, _query_params, _header_params, body=_body_params, post_params=_form_params, files=_files, response_types_map=_response_types_map, auth_settings=_auth_settings, async_req=_params.get('async_req'), _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 _preload_content=_params.get('_preload_content', True), _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth'))
@overload async def list_legacy_compliance_rules(self, effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the rule definitions. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the rule definitions. Defaults to returning the latest version if not specified.")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing entities; this value is returned from the previous call. If a pagination token is provided, the filter, effectiveAt and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the results to this number. Defaults to 100 if not specified.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the results.")] = None, **kwargs) -> ResourceListOfComplianceRule: # noqa: E501 ... @overload def list_legacy_compliance_rules(self, effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the rule definitions. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the rule definitions. Defaults to returning the latest version if not specified.")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing entities; this value is returned from the previous call. If a pagination token is provided, the filter, effectiveAt and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the results to this number. Defaults to 100 if not specified.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the results.")] = None, async_req: Optional[bool]=True, **kwargs) -> ResourceListOfComplianceRule: # noqa: E501 ...
[docs] @validate_arguments def list_legacy_compliance_rules(self, effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the rule definitions. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the rule definitions. Defaults to returning the latest version if not specified.")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing entities; this value is returned from the previous call. If a pagination token is provided, the filter, effectiveAt and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the results to this number. Defaults to 100 if not specified.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the results.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ResourceListOfComplianceRule, Awaitable[ResourceListOfComplianceRule]]: # noqa: E501 """[EXPERIMENTAL] ListLegacyComplianceRules: List compliance rules, with optional filtering. # noqa: E501 For more information about filtering results, see https://support.lusid.com/knowledgebase/article/KA-01914. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_legacy_compliance_rules(effective_at, as_at, page, limit, filter, async_req=True) >>> result = thread.get() :param effective_at: The effective datetime or cut label at which to retrieve the rule definitions. Defaults to the current LUSID system datetime if not specified. :type effective_at: str :param as_at: The asAt datetime at which to retrieve the rule definitions. Defaults to returning the latest version if not specified. :type as_at: datetime :param page: The pagination token to use to continue listing entities; this value is returned from the previous call. If a pagination token is provided, the filter, effectiveAt and asAt fields must not have changed since the original request. :type page: str :param limit: When paginating, limit the results to this number. Defaults to 100 if not specified. :type limit: int :param filter: Expression to filter the results. :type filter: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: ResourceListOfComplianceRule """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: message = "Error! Please call the list_legacy_compliance_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.list_legacy_compliance_rules_with_http_info(effective_at, as_at, page, limit, filter, **kwargs) # noqa: E501
[docs] @validate_arguments def list_legacy_compliance_rules_with_http_info(self, effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which to retrieve the rule definitions. Defaults to the current LUSID system datetime if not specified.")] = None, as_at : Annotated[Optional[datetime], Field(description="The asAt datetime at which to retrieve the rule definitions. Defaults to returning the latest version if not specified.")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing entities; this value is returned from the previous call. If a pagination token is provided, the filter, effectiveAt and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the results to this number. Defaults to 100 if not specified.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the results.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """[EXPERIMENTAL] ListLegacyComplianceRules: List compliance rules, with optional filtering. # noqa: E501 For more information about filtering results, see https://support.lusid.com/knowledgebase/article/KA-01914. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_legacy_compliance_rules_with_http_info(effective_at, as_at, page, limit, filter, async_req=True) >>> result = thread.get() :param effective_at: The effective datetime or cut label at which to retrieve the rule definitions. Defaults to the current LUSID system datetime if not specified. :type effective_at: str :param as_at: The asAt datetime at which to retrieve the rule definitions. Defaults to returning the latest version if not specified. :type as_at: datetime :param page: The pagination token to use to continue listing entities; this value is returned from the previous call. If a pagination token is provided, the filter, effectiveAt and asAt fields must not have changed since the original request. :type page: str :param limit: When paginating, limit the results to this number. Defaults to 100 if not specified. :type limit: int :param filter: Expression to filter the results. :type filter: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional :param _return_http_data_only: response data instead of ApiResponse object with status code, headers, etc :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(ResourceListOfComplianceRule, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ 'effective_at', 'as_at', 'page', 'limit', 'filter' ] _all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) # validate the arguments for _key, _val in _params['kwargs'].items(): if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_legacy_compliance_rules" % _key ) _params[_key] = _val del _params['kwargs'] _collection_formats = {} # process the path parameters _path_params = {} # process the query parameters _query_params = [] if _params.get('effective_at') is not None: # noqa: E501 _query_params.append(('effectiveAt', _params['effective_at'])) if _params.get('as_at') is not None: # noqa: E501 if isinstance(_params['as_at'], datetime): _query_params.append(('asAt', _params['as_at'].strftime(self.api_client.configuration.datetime_format))) else: _query_params.append(('asAt', _params['as_at'])) if _params.get('page') is not None: # noqa: E501 _query_params.append(('page', _params['page'])) if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) if _params.get('filter') is not None: # noqa: E501 _query_params.append(('filter', _params['filter'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters _form_params = [] _files = {} # process the body parameter _body_params = None # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # authentication setting _auth_settings = ['oauth2'] # noqa: E501 _response_types_map = { '200': "ResourceListOfComplianceRule", '400': "LusidValidationProblemDetails", } return self.api_client.call_api( '/api/legacy/compliance/rules', 'GET', _path_params, _query_params, _header_params, body=_body_params, post_params=_form_params, files=_files, response_types_map=_response_types_map, auth_settings=_auth_settings, async_req=_params.get('async_req'), _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 _preload_content=_params.get('_preload_content', True), _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth'))
@overload async def list_legacy_compliance_run_info(self, as_at : Annotated[Optional[datetime], Field(description="Optional. The time at which to get results from. Default : latest")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing compliance runs from a previous call to list compliance runs. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid.")] = None, **kwargs) -> ResourceListOfComplianceRunInfo: # noqa: E501 ... @overload def list_legacy_compliance_run_info(self, as_at : Annotated[Optional[datetime], Field(description="Optional. The time at which to get results from. Default : latest")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing compliance runs from a previous call to list compliance runs. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid.")] = None, async_req: Optional[bool]=True, **kwargs) -> ResourceListOfComplianceRunInfo: # noqa: E501 ...
[docs] @validate_arguments def list_legacy_compliance_run_info(self, as_at : Annotated[Optional[datetime], Field(description="Optional. The time at which to get results from. Default : latest")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing compliance runs from a previous call to list compliance runs. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ResourceListOfComplianceRunInfo, Awaitable[ResourceListOfComplianceRunInfo]]: # noqa: E501 """[EXPERIMENTAL] ListLegacyComplianceRunInfo: List historical compliance run ids. # noqa: E501 Use this endpoint to fetch a list of all historical compliance runs. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_legacy_compliance_run_info(as_at, page, limit, filter, async_req=True) >>> result = thread.get() :param as_at: Optional. The time at which to get results from. Default : latest :type as_at: datetime :param page: The pagination token to use to continue listing compliance runs from a previous call to list compliance runs. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request. :type page: str :param limit: When paginating, limit the number of returned results to this many. :type limit: int :param filter: Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid. :type filter: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: ResourceListOfComplianceRunInfo """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: message = "Error! Please call the list_legacy_compliance_run_info_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.list_legacy_compliance_run_info_with_http_info(as_at, page, limit, filter, **kwargs) # noqa: E501
[docs] @validate_arguments def list_legacy_compliance_run_info_with_http_info(self, as_at : Annotated[Optional[datetime], Field(description="Optional. The time at which to get results from. Default : latest")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="The pagination token to use to continue listing compliance runs from a previous call to list compliance runs. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request.")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="When paginating, limit the number of returned results to this many.")] = None, filter : Annotated[Optional[constr(strict=True, max_length=16384, min_length=0)], Field(description="Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """[EXPERIMENTAL] ListLegacyComplianceRunInfo: List historical compliance run ids. # noqa: E501 Use this endpoint to fetch a list of all historical compliance runs. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_legacy_compliance_run_info_with_http_info(as_at, page, limit, filter, async_req=True) >>> result = thread.get() :param as_at: Optional. The time at which to get results from. Default : latest :type as_at: datetime :param page: The pagination token to use to continue listing compliance runs from a previous call to list compliance runs. This value is returned from the previous call. If a pagination token is provided the sortBy, filter, and asAt fields must not have changed since the original request. :type page: str :param limit: When paginating, limit the number of returned results to this many. :type limit: int :param filter: Expression to filter the result set. Read more about filtering results from LUSID here https://support.lusid.com/filtering-results-from-lusid. :type filter: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional :param _return_http_data_only: response data instead of ApiResponse object with status code, headers, etc :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(ResourceListOfComplianceRunInfo, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ 'as_at', 'page', 'limit', 'filter' ] _all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) # validate the arguments for _key, _val in _params['kwargs'].items(): if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_legacy_compliance_run_info" % _key ) _params[_key] = _val del _params['kwargs'] _collection_formats = {} # process the path parameters _path_params = {} # process the query parameters _query_params = [] if _params.get('as_at') is not None: # noqa: E501 if isinstance(_params['as_at'], datetime): _query_params.append(('asAt', _params['as_at'].strftime(self.api_client.configuration.datetime_format))) else: _query_params.append(('asAt', _params['as_at'])) if _params.get('page') is not None: # noqa: E501 _query_params.append(('page', _params['page'])) if _params.get('limit') is not None: # noqa: E501 _query_params.append(('limit', _params['limit'])) if _params.get('filter') is not None: # noqa: E501 _query_params.append(('filter', _params['filter'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters _form_params = [] _files = {} # process the body parameter _body_params = None # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # authentication setting _auth_settings = ['oauth2'] # noqa: E501 _response_types_map = { '200': "ResourceListOfComplianceRunInfo", '400': "LusidValidationProblemDetails", } return self.api_client.call_api( '/api/legacy/compliance/runs', 'GET', _path_params, _query_params, _header_params, body=_body_params, post_params=_form_params, files=_files, response_types_map=_response_types_map, auth_settings=_auth_settings, async_req=_params.get('async_req'), _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 _preload_content=_params.get('_preload_content', True), _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth'))
@overload async def run_legacy_compliance(self, is_pre_trade : Annotated[StrictBool, Field(..., description="Required: Boolean flag indicating if a run should be PreTrade (Including orders). For post-trade only, set to false")], recipe_id_scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="Required: the scope of the recipe to be used")], recipe_id_code : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional: The code of the recipe to be used. If left blank, the default recipe will be used.")] = None, by_taxlots : Annotated[Optional[StrictBool], Field(description="Optional.")] = None, **kwargs) -> ComplianceRunInfo: # noqa: E501 ... @overload def run_legacy_compliance(self, is_pre_trade : Annotated[StrictBool, Field(..., description="Required: Boolean flag indicating if a run should be PreTrade (Including orders). For post-trade only, set to false")], recipe_id_scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="Required: the scope of the recipe to be used")], recipe_id_code : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional: The code of the recipe to be used. If left blank, the default recipe will be used.")] = None, by_taxlots : Annotated[Optional[StrictBool], Field(description="Optional.")] = None, async_req: Optional[bool]=True, **kwargs) -> ComplianceRunInfo: # noqa: E501 ...
[docs] @validate_arguments def run_legacy_compliance(self, is_pre_trade : Annotated[StrictBool, Field(..., description="Required: Boolean flag indicating if a run should be PreTrade (Including orders). For post-trade only, set to false")], recipe_id_scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="Required: the scope of the recipe to be used")], recipe_id_code : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional: The code of the recipe to be used. If left blank, the default recipe will be used.")] = None, by_taxlots : Annotated[Optional[StrictBool], Field(description="Optional.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ComplianceRunInfo, Awaitable[ComplianceRunInfo]]: # noqa: E501 """[EXPERIMENTAL] RunLegacyCompliance: Kick off the compliance check process # noqa: E501 Use this endpoint to fetch the start a compliance run, based on a pre-set mapping file. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.run_legacy_compliance(is_pre_trade, recipe_id_scope, recipe_id_code, by_taxlots, async_req=True) >>> result = thread.get() :param is_pre_trade: Required: Boolean flag indicating if a run should be PreTrade (Including orders). For post-trade only, set to false (required) :type is_pre_trade: bool :param recipe_id_scope: Required: the scope of the recipe to be used (required) :type recipe_id_scope: str :param recipe_id_code: Optional: The code of the recipe to be used. If left blank, the default recipe will be used. :type recipe_id_code: str :param by_taxlots: Optional. :type by_taxlots: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: ComplianceRunInfo """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: message = "Error! Please call the run_legacy_compliance_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.run_legacy_compliance_with_http_info(is_pre_trade, recipe_id_scope, recipe_id_code, by_taxlots, **kwargs) # noqa: E501
[docs] @validate_arguments def run_legacy_compliance_with_http_info(self, is_pre_trade : Annotated[StrictBool, Field(..., description="Required: Boolean flag indicating if a run should be PreTrade (Including orders). For post-trade only, set to false")], recipe_id_scope : Annotated[constr(strict=True, max_length=64, min_length=1), Field(..., description="Required: the scope of the recipe to be used")], recipe_id_code : Annotated[Optional[constr(strict=True, max_length=64, min_length=1)], Field(description="Optional: The code of the recipe to be used. If left blank, the default recipe will be used.")] = None, by_taxlots : Annotated[Optional[StrictBool], Field(description="Optional.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """[EXPERIMENTAL] RunLegacyCompliance: Kick off the compliance check process # noqa: E501 Use this endpoint to fetch the start a compliance run, based on a pre-set mapping file. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.run_legacy_compliance_with_http_info(is_pre_trade, recipe_id_scope, recipe_id_code, by_taxlots, async_req=True) >>> result = thread.get() :param is_pre_trade: Required: Boolean flag indicating if a run should be PreTrade (Including orders). For post-trade only, set to false (required) :type is_pre_trade: bool :param recipe_id_scope: Required: the scope of the recipe to be used (required) :type recipe_id_scope: str :param recipe_id_code: Optional: The code of the recipe to be used. If left blank, the default recipe will be used. :type recipe_id_code: str :param by_taxlots: Optional. :type by_taxlots: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional :param _return_http_data_only: response data instead of ApiResponse object with status code, headers, etc :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(ComplianceRunInfo, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ 'is_pre_trade', 'recipe_id_scope', 'recipe_id_code', 'by_taxlots' ] _all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) # validate the arguments for _key, _val in _params['kwargs'].items(): if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method run_legacy_compliance" % _key ) _params[_key] = _val del _params['kwargs'] _collection_formats = {} # process the path parameters _path_params = {} # process the query parameters _query_params = [] if _params.get('is_pre_trade') is not None: # noqa: E501 _query_params.append(('isPreTrade', _params['is_pre_trade'])) if _params.get('recipe_id_scope') is not None: # noqa: E501 _query_params.append(('recipeIdScope', _params['recipe_id_scope'])) if _params.get('recipe_id_code') is not None: # noqa: E501 _query_params.append(('recipeIdCode', _params['recipe_id_code'])) if _params.get('by_taxlots') is not None: # noqa: E501 _query_params.append(('byTaxlots', _params['by_taxlots'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters _form_params = [] _files = {} # process the body parameter _body_params = None # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # authentication setting _auth_settings = ['oauth2'] # noqa: E501 _response_types_map = { '200': "ComplianceRunInfo", '400': "LusidValidationProblemDetails", } return self.api_client.call_api( '/api/legacy/compliance/runs', 'POST', _path_params, _query_params, _header_params, body=_body_params, post_params=_form_params, files=_files, response_types_map=_response_types_map, auth_settings=_auth_settings, async_req=_params.get('async_req'), _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 _preload_content=_params.get('_preload_content', True), _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth'))
@overload async def upsert_legacy_compliance_rules(self, request_body : Annotated[Dict[str, ComplianceRuleUpsertRequest], Field(..., description="A dictionary of upsert request identifiers to rule upsert requests. The request identifiers are valid for the request only and can be used to link the upserted compliance rule to the code of a created compliance rule.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which the rule will take effect. Defaults to the current LUSID system datetime if not specified. In the case of an update, the changes will take place from this effective time until the next effective time that the rule as been upserted at. For example, consider a rule that already exists, and has previously had an update applied so that the definition will change on the first day of the coming month. An upsert effective from the current day will only change the definition until the first day of the coming month. An additional upsert at the same time (first day of the month) is required if the newly-updated definition is to supersede the future definition.")] = None, **kwargs) -> ComplianceRuleUpsertResponse: # noqa: E501 ... @overload def upsert_legacy_compliance_rules(self, request_body : Annotated[Dict[str, ComplianceRuleUpsertRequest], Field(..., description="A dictionary of upsert request identifiers to rule upsert requests. The request identifiers are valid for the request only and can be used to link the upserted compliance rule to the code of a created compliance rule.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which the rule will take effect. Defaults to the current LUSID system datetime if not specified. In the case of an update, the changes will take place from this effective time until the next effective time that the rule as been upserted at. For example, consider a rule that already exists, and has previously had an update applied so that the definition will change on the first day of the coming month. An upsert effective from the current day will only change the definition until the first day of the coming month. An additional upsert at the same time (first day of the month) is required if the newly-updated definition is to supersede the future definition.")] = None, async_req: Optional[bool]=True, **kwargs) -> ComplianceRuleUpsertResponse: # noqa: E501 ...
[docs] @validate_arguments def upsert_legacy_compliance_rules(self, request_body : Annotated[Dict[str, ComplianceRuleUpsertRequest], Field(..., description="A dictionary of upsert request identifiers to rule upsert requests. The request identifiers are valid for the request only and can be used to link the upserted compliance rule to the code of a created compliance rule.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which the rule will take effect. Defaults to the current LUSID system datetime if not specified. In the case of an update, the changes will take place from this effective time until the next effective time that the rule as been upserted at. For example, consider a rule that already exists, and has previously had an update applied so that the definition will change on the first day of the coming month. An upsert effective from the current day will only change the definition until the first day of the coming month. An additional upsert at the same time (first day of the month) is required if the newly-updated definition is to supersede the future definition.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ComplianceRuleUpsertResponse, Awaitable[ComplianceRuleUpsertResponse]]: # noqa: E501 """[EXPERIMENTAL] UpsertLegacyComplianceRules: Upsert compliance rules. # noqa: E501 To upsert a new rule, the code field must be left empty, a code will then be assigned and returned as part of the response. To update an existing rule, include the rule code. It is possible to both create and update compliance rules in the same request. The upsert is transactional - either all create/update operations will succeed or none of them will. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.upsert_legacy_compliance_rules(request_body, effective_at, async_req=True) >>> result = thread.get() :param request_body: A dictionary of upsert request identifiers to rule upsert requests. The request identifiers are valid for the request only and can be used to link the upserted compliance rule to the code of a created compliance rule. (required) :type request_body: Dict[str, ComplianceRuleUpsertRequest] :param effective_at: The effective datetime or cut label at which the rule will take effect. Defaults to the current LUSID system datetime if not specified. In the case of an update, the changes will take place from this effective time until the next effective time that the rule as been upserted at. For example, consider a rule that already exists, and has previously had an update applied so that the definition will change on the first day of the coming month. An upsert effective from the current day will only change the definition until the first day of the coming month. An additional upsert at the same time (first day of the month) is required if the newly-updated definition is to supersede the future definition. :type effective_at: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: ComplianceRuleUpsertResponse """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: message = "Error! Please call the upsert_legacy_compliance_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.upsert_legacy_compliance_rules_with_http_info(request_body, effective_at, **kwargs) # noqa: E501
[docs] @validate_arguments def upsert_legacy_compliance_rules_with_http_info(self, request_body : Annotated[Dict[str, ComplianceRuleUpsertRequest], Field(..., description="A dictionary of upsert request identifiers to rule upsert requests. The request identifiers are valid for the request only and can be used to link the upserted compliance rule to the code of a created compliance rule.")], effective_at : Annotated[Optional[StrictStr], Field(description="The effective datetime or cut label at which the rule will take effect. Defaults to the current LUSID system datetime if not specified. In the case of an update, the changes will take place from this effective time until the next effective time that the rule as been upserted at. For example, consider a rule that already exists, and has previously had an update applied so that the definition will change on the first day of the coming month. An upsert effective from the current day will only change the definition until the first day of the coming month. An additional upsert at the same time (first day of the month) is required if the newly-updated definition is to supersede the future definition.")] = None, **kwargs) -> ApiResponse: # noqa: E501 """[EXPERIMENTAL] UpsertLegacyComplianceRules: Upsert compliance rules. # noqa: E501 To upsert a new rule, the code field must be left empty, a code will then be assigned and returned as part of the response. To update an existing rule, include the rule code. It is possible to both create and update compliance rules in the same request. The upsert is transactional - either all create/update operations will succeed or none of them will. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.upsert_legacy_compliance_rules_with_http_info(request_body, effective_at, async_req=True) >>> result = thread.get() :param request_body: A dictionary of upsert request identifiers to rule upsert requests. The request identifiers are valid for the request only and can be used to link the upserted compliance rule to the code of a created compliance rule. (required) :type request_body: Dict[str, ComplianceRuleUpsertRequest] :param effective_at: The effective datetime or cut label at which the rule will take effect. Defaults to the current LUSID system datetime if not specified. In the case of an update, the changes will take place from this effective time until the next effective time that the rule as been upserted at. For example, consider a rule that already exists, and has previously had an update applied so that the definition will change on the first day of the coming month. An upsert effective from the current day will only change the definition until the first day of the coming month. An additional upsert at the same time (first day of the month) is required if the newly-updated definition is to supersede the future definition. :type effective_at: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional :param _return_http_data_only: response data instead of ApiResponse object with status code, headers, etc :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :param _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. :rtype: tuple(ComplianceRuleUpsertResponse, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() _all_params = [ 'request_body', 'effective_at' ] _all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout', '_request_auth', '_content_type', '_headers' ] ) # validate the arguments for _key, _val in _params['kwargs'].items(): if _key not in _all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method upsert_legacy_compliance_rules" % _key ) _params[_key] = _val del _params['kwargs'] _collection_formats = {} # process the path parameters _path_params = {} # process the query parameters _query_params = [] if _params.get('effective_at') is not None: # noqa: E501 _query_params.append(('effectiveAt', _params['effective_at'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) # process the form parameters _form_params = [] _files = {} # process the body parameter _body_params = None if _params['request_body'] is not None: _body_params = _params['request_body'] # set the HTTP header `Accept` _header_params['Accept'] = self.api_client.select_header_accept( ['text/plain', 'application/json', 'text/json']) # noqa: E501 # set the HTTP header `Content-Type` _content_types_list = _params.get('_content_type', self.api_client.select_header_content_type( ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])) if _content_types_list: _header_params['Content-Type'] = _content_types_list # authentication setting _auth_settings = ['oauth2'] # noqa: E501 _response_types_map = { '200': "ComplianceRuleUpsertResponse", '400': "LusidValidationProblemDetails", } return self.api_client.call_api( '/api/legacy/compliance/rules', 'POST', _path_params, _query_params, _header_params, body=_body_params, post_params=_form_params, files=_files, response_types_map=_response_types_map, auth_settings=_auth_settings, async_req=_params.get('async_req'), _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 _preload_content=_params.get('_preload_content', True), _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth'))