# coding: utf-8

"""
    FINBOURNE Access Management 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 pydantic.v1 import Field, StrictStr, conint, conlist, constr, validator

from typing import Dict, List, Optional

from finbourne_access.models.add_to_policy_collection_request import AddToPolicyCollectionRequest
from finbourne_access.models.attached_policy_definition_response import AttachedPolicyDefinitionResponse
from finbourne_access.models.evaluation_request import EvaluationRequest
from finbourne_access.models.evaluation_response import EvaluationResponse
from finbourne_access.models.policy_collection_creation_request import PolicyCollectionCreationRequest
from finbourne_access.models.policy_collection_response import PolicyCollectionResponse
from finbourne_access.models.policy_collection_update_request import PolicyCollectionUpdateRequest
from finbourne_access.models.policy_creation_request import PolicyCreationRequest
from finbourne_access.models.policy_response import PolicyResponse
from finbourne_access.models.policy_update_request import PolicyUpdateRequest
from finbourne_access.models.remove_from_policy_collection_request import RemoveFromPolicyCollectionRequest
from finbourne_access.models.resource_list_of_policy_collection_response import ResourceListOfPolicyCollectionResponse
from finbourne_access.models.resource_list_of_policy_response import ResourceListOfPolicyResponse

from finbourne_access.api_client import ApiClient
from finbourne_access.api_response import ApiResponse
from finbourne_access.exceptions import (  # noqa: F401
    ApiTypeError,
    ApiValueError
)
from finbourne_access.extensions.configuration_options import ConfigurationOptions


class PoliciesApi:
    """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 add_to_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], add_to_policy_collection_request : Annotated[AddToPolicyCollectionRequest, Field(..., description="Ids of the PolicyCollections and/or Policies to add to the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @overload
    def add_to_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], add_to_policy_collection_request : Annotated[AddToPolicyCollectionRequest, Field(..., description="Ids of the PolicyCollections and/or Policies to add to the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=True, **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @validate_arguments
    def add_to_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], add_to_policy_collection_request : Annotated[AddToPolicyCollectionRequest, Field(..., description="Ids of the PolicyCollections and/or Policies to add to the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[PolicyCollectionResponse, Awaitable[PolicyCollectionResponse]]:  # noqa: E501
        """AddToPolicyCollection: Add To PolicyCollection  # noqa: E501

        Add Policies and/or PolicyCollections to a PolicyCollection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.add_to_policy_collection(code, add_to_policy_collection_request, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param add_to_policy_collection_request: Ids of the PolicyCollections and/or Policies to add to the PolicyCollection (required)
        :type add_to_policy_collection_request: AddToPolicyCollectionRequest
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PolicyCollectionResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the add_to_policy_collection_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.add_to_policy_collection_with_http_info(code, add_to_policy_collection_request, scope, **kwargs)  # noqa: E501

    @validate_arguments
    def add_to_policy_collection_with_http_info(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], add_to_policy_collection_request : Annotated[AddToPolicyCollectionRequest, Field(..., description="Ids of the PolicyCollections and/or Policies to add to the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """AddToPolicyCollection: Add To PolicyCollection  # noqa: E501

        Add Policies and/or PolicyCollections to a PolicyCollection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.add_to_policy_collection_with_http_info(code, add_to_policy_collection_request, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param add_to_policy_collection_request: Ids of the PolicyCollections and/or Policies to add to the PolicyCollection (required)
        :type add_to_policy_collection_request: AddToPolicyCollectionRequest
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(PolicyCollectionResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'code',
            'add_to_policy_collection_request',
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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 add_to_policy_collection" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['code']:
            _path_params['code'] = _params['code']


        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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['add_to_policy_collection_request'] is not None:
            _body_params = _params['add_to_policy_collection_request']

        # 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': "PolicyCollectionResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policycollections/{code}/add', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def create_policy(self, policy_creation_request : Annotated[PolicyCreationRequest, Field(..., description="The definition of the Policy")], **kwargs) -> PolicyResponse:  # noqa: E501
        ...

    @overload
    def create_policy(self, policy_creation_request : Annotated[PolicyCreationRequest, Field(..., description="The definition of the Policy")], async_req: Optional[bool]=True, **kwargs) -> PolicyResponse:  # noqa: E501
        ...

    @validate_arguments
    def create_policy(self, policy_creation_request : Annotated[PolicyCreationRequest, Field(..., description="The definition of the Policy")], async_req: Optional[bool]=None, **kwargs) -> Union[PolicyResponse, Awaitable[PolicyResponse]]:  # noqa: E501
        """CreatePolicy: Create Policy  # noqa: E501

        Creates a Policy  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.create_policy(policy_creation_request, async_req=True)
        >>> result = thread.get()

        :param policy_creation_request: The definition of the Policy (required)
        :type policy_creation_request: PolicyCreationRequest
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PolicyResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the create_policy_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.create_policy_with_http_info(policy_creation_request, **kwargs)  # noqa: E501

    @validate_arguments
    def create_policy_with_http_info(self, policy_creation_request : Annotated[PolicyCreationRequest, Field(..., description="The definition of the Policy")], **kwargs) -> ApiResponse:  # noqa: E501
        """CreatePolicy: Create Policy  # noqa: E501

        Creates a Policy  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.create_policy_with_http_info(policy_creation_request, async_req=True)
        >>> result = thread.get()

        :param policy_creation_request: The definition of the Policy (required)
        :type policy_creation_request: PolicyCreationRequest
        :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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(PolicyResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'policy_creation_request'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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 create_policy" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # 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
        if _params['policy_creation_request'] is not None:
            _body_params = _params['policy_creation_request']

        # 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 = {
            '201': "PolicyResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policies', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def create_policy_collection(self, policy_collection_creation_request : Annotated[PolicyCollectionCreationRequest, Field(..., description="The definition of the PolicyCollection")], **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @overload
    def create_policy_collection(self, policy_collection_creation_request : Annotated[PolicyCollectionCreationRequest, Field(..., description="The definition of the PolicyCollection")], async_req: Optional[bool]=True, **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @validate_arguments
    def create_policy_collection(self, policy_collection_creation_request : Annotated[PolicyCollectionCreationRequest, Field(..., description="The definition of the PolicyCollection")], async_req: Optional[bool]=None, **kwargs) -> Union[PolicyCollectionResponse, Awaitable[PolicyCollectionResponse]]:  # noqa: E501
        """CreatePolicyCollection: Create PolicyCollection  # noqa: E501

        Creates a PolicyCollection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.create_policy_collection(policy_collection_creation_request, async_req=True)
        >>> result = thread.get()

        :param policy_collection_creation_request: The definition of the PolicyCollection (required)
        :type policy_collection_creation_request: PolicyCollectionCreationRequest
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PolicyCollectionResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the create_policy_collection_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.create_policy_collection_with_http_info(policy_collection_creation_request, **kwargs)  # noqa: E501

    @validate_arguments
    def create_policy_collection_with_http_info(self, policy_collection_creation_request : Annotated[PolicyCollectionCreationRequest, Field(..., description="The definition of the PolicyCollection")], **kwargs) -> ApiResponse:  # noqa: E501
        """CreatePolicyCollection: Create PolicyCollection  # noqa: E501

        Creates a PolicyCollection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.create_policy_collection_with_http_info(policy_collection_creation_request, async_req=True)
        >>> result = thread.get()

        :param policy_collection_creation_request: The definition of the PolicyCollection (required)
        :type policy_collection_creation_request: PolicyCollectionCreationRequest
        :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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(PolicyCollectionResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'policy_collection_creation_request'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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 create_policy_collection" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # 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
        if _params['policy_collection_creation_request'] is not None:
            _body_params = _params['policy_collection_creation_request']

        # 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 = {
            '201': "PolicyCollectionResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policycollections', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def delete_policy(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, **kwargs) -> None:  # noqa: E501
        ...

    @overload
    def delete_policy(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, async_req: Optional[bool]=True, **kwargs) -> None:  # noqa: E501
        ...

    @validate_arguments
    def delete_policy(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]:  # noqa: E501
        """DeletePolicy: Delete Policy  # noqa: E501

        Deletes an identified Policy  # 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_policy(code, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the Policy (required)
        :type code: str
        :param scope: Optional. Will use the default scope if not provided. The scope of the Policy
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the delete_policy_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_policy_with_http_info(code, scope, **kwargs)  # noqa: E501

    @validate_arguments
    def delete_policy_with_http_info(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """DeletePolicy: Delete Policy  # noqa: E501

        Deletes an identified Policy  # 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_policy_with_http_info(code, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the Policy (required)
        :type code: str
        :param scope: Optional. Will use the default scope if not provided. The scope of the Policy
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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: None
        """

        _params = locals()

        _all_params = [
            'code',
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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_policy" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['code']:
            _path_params['code'] = _params['code']


        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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 = {}

        return self.api_client.call_api(
            '/api/policies/{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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def delete_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> None:  # noqa: E501
        ...

    @overload
    def delete_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=True, **kwargs) -> None:  # noqa: E501
        ...

    @validate_arguments
    def delete_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]:  # noqa: E501
        """DeletePolicyCollection: Delete PolicyCollection  # noqa: E501

        Deletes an identified PolicyCollection  # 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_policy_collection(code, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: None
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the delete_policy_collection_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_policy_collection_with_http_info(code, scope, **kwargs)  # noqa: E501

    @validate_arguments
    def delete_policy_collection_with_http_info(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """DeletePolicyCollection: Delete PolicyCollection  # noqa: E501

        Deletes an identified PolicyCollection  # 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_policy_collection_with_http_info(code, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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: None
        """

        _params = locals()

        _all_params = [
            'code',
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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_policy_collection" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['code']:
            _path_params['code'] = _params['code']


        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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 = {}

        return self.api_client.call_api(
            '/api/policycollections/{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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def evaluate(self, request_body : Annotated[Dict[str, EvaluationRequest], Field(..., description="A dictionary of evaluations, keyed using any arbitrary correlation id (it will be returned with the response for that evaluation).")], applications : Annotated[Optional[conlist(StrictStr)], Field(description="Optional. The application type of the roles and policies to use when evaluating.")] = None, **kwargs) -> Dict[str, EvaluationResponse]:  # noqa: E501
        ...

    @overload
    def evaluate(self, request_body : Annotated[Dict[str, EvaluationRequest], Field(..., description="A dictionary of evaluations, keyed using any arbitrary correlation id (it will be returned with the response for that evaluation).")], applications : Annotated[Optional[conlist(StrictStr)], Field(description="Optional. The application type of the roles and policies to use when evaluating.")] = None, async_req: Optional[bool]=True, **kwargs) -> Dict[str, EvaluationResponse]:  # noqa: E501
        ...

    @validate_arguments
    def evaluate(self, request_body : Annotated[Dict[str, EvaluationRequest], Field(..., description="A dictionary of evaluations, keyed using any arbitrary correlation id (it will be returned with the response for that evaluation).")], applications : Annotated[Optional[conlist(StrictStr)], Field(description="Optional. The application type of the roles and policies to use when evaluating.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[Dict[str, EvaluationResponse], Awaitable[Dict[str, EvaluationResponse]]]:  # noqa: E501
        """Evaluate: Run one or more evaluations  # noqa: E501

        Given a dictionary of evaluation requests (keyed by any arbitrary correlation identifier), each will be evaluated according to the current user's policies (deduced from the provided OAuth token).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.evaluate(request_body, applications, async_req=True)
        >>> result = thread.get()

        :param request_body: A dictionary of evaluations, keyed using any arbitrary correlation id (it will be returned with the response for that evaluation). (required)
        :type request_body: Dict[str, EvaluationRequest]
        :param applications: Optional. The application type of the roles and policies to use when evaluating.
        :type applications: List[str]
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: Dict[str, EvaluationResponse]
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the evaluate_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.evaluate_with_http_info(request_body, applications, **kwargs)  # noqa: E501

    @validate_arguments
    def evaluate_with_http_info(self, request_body : Annotated[Dict[str, EvaluationRequest], Field(..., description="A dictionary of evaluations, keyed using any arbitrary correlation id (it will be returned with the response for that evaluation).")], applications : Annotated[Optional[conlist(StrictStr)], Field(description="Optional. The application type of the roles and policies to use when evaluating.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Evaluate: Run one or more evaluations  # noqa: E501

        Given a dictionary of evaluation requests (keyed by any arbitrary correlation identifier), each will be evaluated according to the current user's policies (deduced from the provided OAuth token).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.evaluate_with_http_info(request_body, applications, async_req=True)
        >>> result = thread.get()

        :param request_body: A dictionary of evaluations, keyed using any arbitrary correlation id (it will be returned with the response for that evaluation). (required)
        :type request_body: Dict[str, EvaluationRequest]
        :param applications: Optional. The application type of the roles and policies to use when evaluating.
        :type applications: List[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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(Dict[str, EvaluationResponse], status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'request_body',
            'applications'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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 evaluate" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        if _params.get('applications') is not None:  # noqa: E501
            _query_params.append(('applications', _params['applications']))
            _collection_formats['applications'] = 'multi'

        # 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': "Dict[str, EvaluationResponse]",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/me', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def get_own_policies(self, applications : Annotated[Optional[conlist(StrictStr)], Field(description="Optional. Filter on the applications that the policies apply to")] = None, **kwargs) -> List[AttachedPolicyDefinitionResponse]:  # noqa: E501
        ...

    @overload
    def get_own_policies(self, applications : Annotated[Optional[conlist(StrictStr)], Field(description="Optional. Filter on the applications that the policies apply to")] = None, async_req: Optional[bool]=True, **kwargs) -> List[AttachedPolicyDefinitionResponse]:  # noqa: E501
        ...

    @validate_arguments
    def get_own_policies(self, applications : Annotated[Optional[conlist(StrictStr)], Field(description="Optional. Filter on the applications that the policies apply to")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[List[AttachedPolicyDefinitionResponse], Awaitable[List[AttachedPolicyDefinitionResponse]]]:  # noqa: E501
        """GetOwnPolicies: Get policies of requesting user  # noqa: E501

        Gets all Policies for the current user  # 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_own_policies(applications, async_req=True)
        >>> result = thread.get()

        :param applications: Optional. Filter on the applications that the policies apply to
        :type applications: List[str]
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: List[AttachedPolicyDefinitionResponse]
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the get_own_policies_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_own_policies_with_http_info(applications, **kwargs)  # noqa: E501

    @validate_arguments
    def get_own_policies_with_http_info(self, applications : Annotated[Optional[conlist(StrictStr)], Field(description="Optional. Filter on the applications that the policies apply to")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """GetOwnPolicies: Get policies of requesting user  # noqa: E501

        Gets all Policies for the current user  # 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_own_policies_with_http_info(applications, async_req=True)
        >>> result = thread.get()

        :param applications: Optional. Filter on the applications that the policies apply to
        :type applications: List[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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(List[AttachedPolicyDefinitionResponse], status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'applications'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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_own_policies" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        if _params.get('applications') is not None:  # noqa: E501
            _query_params.append(('applications', _params['applications']))
            _collection_formats['applications'] = 'multi'

        # 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': "List[AttachedPolicyDefinitionResponse]",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/me', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def get_policy(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, **kwargs) -> PolicyResponse:  # noqa: E501
        ...

    @overload
    def get_policy(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, async_req: Optional[bool]=True, **kwargs) -> PolicyResponse:  # noqa: E501
        ...

    @validate_arguments
    def get_policy(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[PolicyResponse, Awaitable[PolicyResponse]]:  # noqa: E501
        """GetPolicy: Get Policy  # noqa: E501

        Gets an identified Policy  # 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_policy(code, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the Policy (required)
        :type code: str
        :param scope: Optional. Will use the default scope if not provided. The scope of the Policy
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PolicyResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the get_policy_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_policy_with_http_info(code, scope, **kwargs)  # noqa: E501

    @validate_arguments
    def get_policy_with_http_info(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """GetPolicy: Get Policy  # noqa: E501

        Gets an identified Policy  # 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_policy_with_http_info(code, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the Policy (required)
        :type code: str
        :param scope: Optional. Will use the default scope if not provided. The scope of the Policy
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(PolicyResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'code',
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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_policy" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['code']:
            _path_params['code'] = _params['code']


        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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': "PolicyResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policies/{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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def get_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @overload
    def get_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=True, **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @validate_arguments
    def get_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[PolicyCollectionResponse, Awaitable[PolicyCollectionResponse]]:  # noqa: E501
        """GetPolicyCollection: Get PolicyCollection  # noqa: E501

        Gets an identified PolicyCollection  # 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_policy_collection(code, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PolicyCollectionResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the get_policy_collection_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_policy_collection_with_http_info(code, scope, **kwargs)  # noqa: E501

    @validate_arguments
    def get_policy_collection_with_http_info(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """GetPolicyCollection: Get PolicyCollection  # noqa: E501

        Gets an identified PolicyCollection  # 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_policy_collection_with_http_info(code, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(PolicyCollectionResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'code',
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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_policy_collection" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['code']:
            _path_params['code'] = _params['code']


        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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': "PolicyCollectionResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policycollections/{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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def list_policies(self, scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The requested scope")] = None, **kwargs) -> List[PolicyResponse]:  # noqa: E501
        ...

    @overload
    def list_policies(self, scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The requested scope")] = None, async_req: Optional[bool]=True, **kwargs) -> List[PolicyResponse]:  # noqa: E501
        ...

    @validate_arguments
    def list_policies(self, scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The requested scope")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[List[PolicyResponse], Awaitable[List[PolicyResponse]]]:  # noqa: E501
        """ListPolicies: List Policies  # noqa: E501

        Gets all Policies in a scope. For pagination support, use PagePolicies.  # 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_policies(scope, async_req=True)
        >>> result = thread.get()

        :param scope: Optional. Will use the default scope if not provided. The requested scope
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: List[PolicyResponse]
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the list_policies_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_policies_with_http_info(scope, **kwargs)  # noqa: E501

    @validate_arguments
    def list_policies_with_http_info(self, scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The requested scope")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """ListPolicies: List Policies  # noqa: E501

        Gets all Policies in a scope. For pagination support, use PagePolicies.  # 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_policies_with_http_info(scope, async_req=True)
        >>> result = thread.get()

        :param scope: Optional. Will use the default scope if not provided. The requested scope
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(List[PolicyResponse], status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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_policies" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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': "List[PolicyResponse]",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policies', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def list_policy_collections(self, scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The requested scope")] = None, **kwargs) -> List[PolicyCollectionResponse]:  # noqa: E501
        ...

    @overload
    def list_policy_collections(self, scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The requested scope")] = None, async_req: Optional[bool]=True, **kwargs) -> List[PolicyCollectionResponse]:  # noqa: E501
        ...

    @validate_arguments
    def list_policy_collections(self, scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The requested scope")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[List[PolicyCollectionResponse], Awaitable[List[PolicyCollectionResponse]]]:  # noqa: E501
        """ListPolicyCollections: List PolicyCollections  # noqa: E501

        Gets all PolicyCollections in a scope. For pagination support, use PagePolicyCollections  # 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_policy_collections(scope, async_req=True)
        >>> result = thread.get()

        :param scope: Optional. Will use the default scope if not provided. The requested scope
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: List[PolicyCollectionResponse]
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the list_policy_collections_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_policy_collections_with_http_info(scope, **kwargs)  # noqa: E501

    @validate_arguments
    def list_policy_collections_with_http_info(self, scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The requested scope")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """ListPolicyCollections: List PolicyCollections  # noqa: E501

        Gets all PolicyCollections in a scope. For pagination support, use PagePolicyCollections  # 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_policy_collections_with_http_info(scope, async_req=True)
        >>> result = thread.get()

        :param scope: Optional. Will use the default scope if not provided. The requested scope
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(List[PolicyCollectionResponse], status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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_policy_collections" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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': "List[PolicyCollectionResponse]",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policycollections', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def page_policies(self, sort_by : Annotated[Optional[constr(strict=True, max_length=16384, min_length=1)], Field(description="Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="Optional. 2000 if not provided. 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="Optional. Expression to filter the result set")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="Optional. Paging token returned from a previous result")] = None, **kwargs) -> ResourceListOfPolicyResponse:  # noqa: E501
        ...

    @overload
    def page_policies(self, sort_by : Annotated[Optional[constr(strict=True, max_length=16384, min_length=1)], Field(description="Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="Optional. 2000 if not provided. 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="Optional. Expression to filter the result set")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="Optional. Paging token returned from a previous result")] = None, async_req: Optional[bool]=True, **kwargs) -> ResourceListOfPolicyResponse:  # noqa: E501
        ...

    @validate_arguments
    def page_policies(self, sort_by : Annotated[Optional[constr(strict=True, max_length=16384, min_length=1)], Field(description="Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="Optional. 2000 if not provided. 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="Optional. Expression to filter the result set")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="Optional. Paging token returned from a previous result")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ResourceListOfPolicyResponse, Awaitable[ResourceListOfPolicyResponse]]:  # noqa: E501
        """PagePolicies: Page Policies  # noqa: E501

        Gets all Policies with pagination support.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.page_policies(sort_by, limit, filter, page, async_req=True)
        >>> result = thread.get()

        :param sort_by: Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName
        :type sort_by: str
        :param limit: Optional. 2000 if not provided. When paginating, limit the number of returned results to this many
        :type limit: int
        :param filter: Optional. Expression to filter the result set
        :type filter: str
        :param page: Optional. Paging token returned from a previous result
        :type page: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: ResourceListOfPolicyResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the page_policies_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.page_policies_with_http_info(sort_by, limit, filter, page, **kwargs)  # noqa: E501

    @validate_arguments
    def page_policies_with_http_info(self, sort_by : Annotated[Optional[constr(strict=True, max_length=16384, min_length=1)], Field(description="Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="Optional. 2000 if not provided. 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="Optional. Expression to filter the result set")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="Optional. Paging token returned from a previous result")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """PagePolicies: Page Policies  # noqa: E501

        Gets all Policies with pagination support.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.page_policies_with_http_info(sort_by, limit, filter, page, async_req=True)
        >>> result = thread.get()

        :param sort_by: Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName
        :type sort_by: str
        :param limit: Optional. 2000 if not provided. When paginating, limit the number of returned results to this many
        :type limit: int
        :param filter: Optional. Expression to filter the result set
        :type filter: str
        :param page: Optional. Paging token returned from a previous result
        :type page: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(ResourceListOfPolicyResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'sort_by',
            'limit',
            'filter',
            'page'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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 page_policies" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        if _params.get('sort_by') is not None:  # noqa: E501
            _query_params.append(('sortBy', _params['sort_by']))

        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']))

        if _params.get('page') is not None:  # noqa: E501
            _query_params.append(('page', _params['page']))

        # 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': "ResourceListOfPolicyResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policies/page', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def page_policy_collections(self, sort_by : Annotated[Optional[constr(strict=True, max_length=16384, min_length=1)], Field(description="Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="Optional. 2000 if not provided. 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="Optional. Expression to filter the result set")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="Optional. Paging token returned from a previous result")] = None, **kwargs) -> ResourceListOfPolicyCollectionResponse:  # noqa: E501
        ...

    @overload
    def page_policy_collections(self, sort_by : Annotated[Optional[constr(strict=True, max_length=16384, min_length=1)], Field(description="Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="Optional. 2000 if not provided. 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="Optional. Expression to filter the result set")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="Optional. Paging token returned from a previous result")] = None, async_req: Optional[bool]=True, **kwargs) -> ResourceListOfPolicyCollectionResponse:  # noqa: E501
        ...

    @validate_arguments
    def page_policy_collections(self, sort_by : Annotated[Optional[constr(strict=True, max_length=16384, min_length=1)], Field(description="Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="Optional. 2000 if not provided. 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="Optional. Expression to filter the result set")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="Optional. Paging token returned from a previous result")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[ResourceListOfPolicyCollectionResponse, Awaitable[ResourceListOfPolicyCollectionResponse]]:  # noqa: E501
        """PagePolicyCollections: Page PolicyCollections  # noqa: E501

        Gets all PolicyCollections with pagination support.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.page_policy_collections(sort_by, limit, filter, page, async_req=True)
        >>> result = thread.get()

        :param sort_by: Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName
        :type sort_by: str
        :param limit: Optional. 2000 if not provided. When paginating, limit the number of returned results to this many
        :type limit: int
        :param filter: Optional. Expression to filter the result set
        :type filter: str
        :param page: Optional. Paging token returned from a previous result
        :type page: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: ResourceListOfPolicyCollectionResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the page_policy_collections_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.page_policy_collections_with_http_info(sort_by, limit, filter, page, **kwargs)  # noqa: E501

    @validate_arguments
    def page_policy_collections_with_http_info(self, sort_by : Annotated[Optional[constr(strict=True, max_length=16384, min_length=1)], Field(description="Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName")] = None, limit : Annotated[Optional[conint(strict=True, le=5000, ge=1)], Field(description="Optional. 2000 if not provided. 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="Optional. Expression to filter the result set")] = None, page : Annotated[Optional[constr(strict=True, max_length=500, min_length=1)], Field(description="Optional. Paging token returned from a previous result")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """PagePolicyCollections: Page PolicyCollections  # noqa: E501

        Gets all PolicyCollections with pagination support.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.page_policy_collections_with_http_info(sort_by, limit, filter, page, async_req=True)
        >>> result = thread.get()

        :param sort_by: Optional. Order the results by these fields. Use the '-' sign to denote descending order e.g. -MyFieldName
        :type sort_by: str
        :param limit: Optional. 2000 if not provided. When paginating, limit the number of returned results to this many
        :type limit: int
        :param filter: Optional. Expression to filter the result set
        :type filter: str
        :param page: Optional. Paging token returned from a previous result
        :type page: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(ResourceListOfPolicyCollectionResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'sort_by',
            'limit',
            'filter',
            'page'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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 page_policy_collections" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        if _params.get('sort_by') is not None:  # noqa: E501
            _query_params.append(('sortBy', _params['sort_by']))

        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']))

        if _params.get('page') is not None:  # noqa: E501
            _query_params.append(('page', _params['page']))

        # 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': "ResourceListOfPolicyCollectionResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policycollections/page', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def remove_from_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], remove_from_policy_collection_request : Annotated[RemoveFromPolicyCollectionRequest, Field(..., description="Ids of the PolicyCollections and/or Policies to remove from the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @overload
    def remove_from_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], remove_from_policy_collection_request : Annotated[RemoveFromPolicyCollectionRequest, Field(..., description="Ids of the PolicyCollections and/or Policies to remove from the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=True, **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @validate_arguments
    def remove_from_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], remove_from_policy_collection_request : Annotated[RemoveFromPolicyCollectionRequest, Field(..., description="Ids of the PolicyCollections and/or Policies to remove from the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[PolicyCollectionResponse, Awaitable[PolicyCollectionResponse]]:  # noqa: E501
        """RemoveFromPolicyCollection: Remove From PolicyCollection  # noqa: E501

        Remove Policies and/or PolicyCollections from a PolicyCollection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.remove_from_policy_collection(code, remove_from_policy_collection_request, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param remove_from_policy_collection_request: Ids of the PolicyCollections and/or Policies to remove from the PolicyCollection (required)
        :type remove_from_policy_collection_request: RemoveFromPolicyCollectionRequest
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PolicyCollectionResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the remove_from_policy_collection_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.remove_from_policy_collection_with_http_info(code, remove_from_policy_collection_request, scope, **kwargs)  # noqa: E501

    @validate_arguments
    def remove_from_policy_collection_with_http_info(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], remove_from_policy_collection_request : Annotated[RemoveFromPolicyCollectionRequest, Field(..., description="Ids of the PolicyCollections and/or Policies to remove from the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """RemoveFromPolicyCollection: Remove From PolicyCollection  # noqa: E501

        Remove Policies and/or PolicyCollections from a PolicyCollection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.remove_from_policy_collection_with_http_info(code, remove_from_policy_collection_request, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param remove_from_policy_collection_request: Ids of the PolicyCollections and/or Policies to remove from the PolicyCollection (required)
        :type remove_from_policy_collection_request: RemoveFromPolicyCollectionRequest
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(PolicyCollectionResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'code',
            'remove_from_policy_collection_request',
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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 remove_from_policy_collection" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['code']:
            _path_params['code'] = _params['code']


        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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['remove_from_policy_collection_request'] is not None:
            _body_params = _params['remove_from_policy_collection_request']

        # 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': "PolicyCollectionResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policycollections/{code}/remove', '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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def update_policy(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], policy_update_request : Annotated[PolicyUpdateRequest, Field(..., description="The updated definition of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, **kwargs) -> PolicyResponse:  # noqa: E501
        ...

    @overload
    def update_policy(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], policy_update_request : Annotated[PolicyUpdateRequest, Field(..., description="The updated definition of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, async_req: Optional[bool]=True, **kwargs) -> PolicyResponse:  # noqa: E501
        ...

    @validate_arguments
    def update_policy(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], policy_update_request : Annotated[PolicyUpdateRequest, Field(..., description="The updated definition of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[PolicyResponse, Awaitable[PolicyResponse]]:  # noqa: E501
        """UpdatePolicy: Update Policy  # noqa: E501

        Updates a Policy  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.update_policy(code, policy_update_request, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the Policy (required)
        :type code: str
        :param policy_update_request: The updated definition of the Policy (required)
        :type policy_update_request: PolicyUpdateRequest
        :param scope: Optional. Will use the default scope if not provided. The scope of the Policy
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PolicyResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the update_policy_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.update_policy_with_http_info(code, policy_update_request, scope, **kwargs)  # noqa: E501

    @validate_arguments
    def update_policy_with_http_info(self, code : Annotated[constr(strict=True), Field(..., description="The code of the Policy")], policy_update_request : Annotated[PolicyUpdateRequest, Field(..., description="The updated definition of the Policy")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the Policy")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """UpdatePolicy: Update Policy  # noqa: E501

        Updates a Policy  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.update_policy_with_http_info(code, policy_update_request, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the Policy (required)
        :type code: str
        :param policy_update_request: The updated definition of the Policy (required)
        :type policy_update_request: PolicyUpdateRequest
        :param scope: Optional. Will use the default scope if not provided. The scope of the Policy
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(PolicyResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'code',
            'policy_update_request',
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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 update_policy" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['code']:
            _path_params['code'] = _params['code']


        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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['policy_update_request'] is not None:
            _body_params = _params['policy_update_request']

        # 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': "PolicyResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policies/{code}', 'PUT',
            _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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def update_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], policy_collection_update_request : Annotated[PolicyCollectionUpdateRequest, Field(..., description="The updated definition of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @overload
    def update_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], policy_collection_update_request : Annotated[PolicyCollectionUpdateRequest, Field(..., description="The updated definition of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=True, **kwargs) -> PolicyCollectionResponse:  # noqa: E501
        ...

    @validate_arguments
    def update_policy_collection(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], policy_collection_update_request : Annotated[PolicyCollectionUpdateRequest, Field(..., description="The updated definition of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[PolicyCollectionResponse, Awaitable[PolicyCollectionResponse]]:  # noqa: E501
        """UpdatePolicyCollection: Update PolicyCollection  # noqa: E501

        Updates a PolicyCollection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.update_policy_collection(code, policy_collection_update_request, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param policy_collection_update_request: The updated definition of the PolicyCollection (required)
        :type policy_collection_update_request: PolicyCollectionUpdateRequest
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: Timeout setting. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: PolicyCollectionResponse
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            message = "Error! Please call the update_policy_collection_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.update_policy_collection_with_http_info(code, policy_collection_update_request, scope, **kwargs)  # noqa: E501

    @validate_arguments
    def update_policy_collection_with_http_info(self, code : Annotated[constr(strict=True), Field(..., description="The code of the PolicyCollection")], policy_collection_update_request : Annotated[PolicyCollectionUpdateRequest, Field(..., description="The updated definition of the PolicyCollection")], scope : Annotated[Optional[constr(strict=True)], Field(description="Optional. Will use the default scope if not provided. The scope of the PolicyCollection")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """UpdatePolicyCollection: Update PolicyCollection  # noqa: E501

        Updates a PolicyCollection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.update_policy_collection_with_http_info(code, policy_collection_update_request, scope, async_req=True)
        >>> result = thread.get()

        :param code: The code of the PolicyCollection (required)
        :type code: str
        :param policy_collection_update_request: The updated definition of the PolicyCollection (required)
        :type policy_collection_update_request: PolicyCollectionUpdateRequest
        :param scope: Optional. Will use the default scope if not provided. The scope of the PolicyCollection
        :type scope: 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. Do not use - use the opts parameter instead
        :param opts: Configuration options for this request
        :type opts: ConfigurationOptions, optional
        :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(PolicyCollectionResponse, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'code',
            'policy_collection_update_request',
            'scope'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers',
                'opts'
            ]
        )

        # 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 update_policy_collection" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['code']:
            _path_params['code'] = _params['code']


        # process the query parameters
        _query_params = []
        if _params.get('scope') is not None:  # noqa: E501
            _query_params.append(('scope', _params['scope']))

        # 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['policy_collection_update_request'] is not None:
            _body_params = _params['policy_collection_update_request']

        # 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': "PolicyCollectionResponse",
            '400': "LusidValidationProblemDetails",
        }

        return self.api_client.call_api(
            '/api/policycollections/{code}', 'PUT',
            _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'),
            opts=_params.get('opts'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))
