# coding: utf-8

"""
    Acre Platform User API

    # CORS CORS is implemented by all Acre API endpoints and only certain hostnames are allowed for each deployment of the API. If your use case requires calling the Acre User API from a browser, please contact Acre to arrange the appropriate configuration. # API Authentication The primary method of authentication for users of the Acre API is with the use of JSON Web Tokens (JWTs), which are suplemented by an application specific API Key. The API key must be provided through the `X-API-KEY` HTTP header and will be provided by your Acre Customer Success Manager. The JWT must be provided through a cookie with key of `authorization`. The JWT must be generated and signed as per the following section. # Generating JWTs JWT must either be generated by a third-party such as Azure ADB2C that has been configured for the appropriate service and/or user account, or alternatively can be generated locally and signed by an private key for which the public key has been made available to Acre via a JWKS URL. In addition to being signed by your private key, the JWT will also need to contain at a minimum:  * An issuer `iss`, which must be a valid URI previously agreed with Acre.  * A subject `sub`, which must be a unique identifier for the user and/or service account previously agreed with Acre.  * An expiry time `exp` which must not be more than four hours in the future.  * A not before time `nbf` which must be in the past, but not greater than six hours in the past.  The JWT should be signed using RS256.

    The version of the OpenAPI document: 1.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator
from typing import List, Optional
from typing_extensions import Annotated
from acre_api.models.cdm_create_user_response import CdmCreateUserResponse
from acre_api.models.cdm_get_me_response import CdmGetMeResponse
from acre_api.models.cdm_get_user_response import CdmGetUserResponse
from acre_api.models.cdm_replace_user_response import CdmReplaceUserResponse
from acre_api.models.cdm_update_user_response import CdmUpdateUserResponse
from acre_api.models.cdm_user import CdmUser
from acre_api.models.full_details_of_the_user_to_be_replaced_required import FullDetailsOfTheUserToBeReplacedRequired
from acre_api.models.partial_details_of_the_user_to_be_patched_required import PartialDetailsOfTheUserToBePatchedRequired

from acre_api.api_client import ApiClient, RequestSerialized
from acre_api.api_response import ApiResponse
from acre_api.rest import RESTResponseType


class UserApi:
    """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


    @validate_call
    def create_user(
        self,
        user: Annotated[CdmUser, Field(description="Details of the user to be created. Required.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CdmCreateUserResponse:
        """Create a new user.


        :param user: Details of the user to be created. Required. (required)
        :type user: CdmUser
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_user_serialize(
            user=user,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmCreateUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def create_user_with_http_info(
        self,
        user: Annotated[CdmUser, Field(description="Details of the user to be created. Required.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CdmCreateUserResponse]:
        """Create a new user.


        :param user: Details of the user to be created. Required. (required)
        :type user: CdmUser
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_user_serialize(
            user=user,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmCreateUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def create_user_without_preload_content(
        self,
        user: Annotated[CdmUser, Field(description="Details of the user to be created. Required.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create a new user.


        :param user: Details of the user to be created. Required. (required)
        :type user: CdmUser
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_user_serialize(
            user=user,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmCreateUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _create_user_serialize(
        self,
        user,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if user is not None:
            _body_params = user


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/acre/user',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_me(
        self,
        ignore_cache: Annotated[Optional[StrictBool], Field(description="Ignore the cache and retrieve from the Phylum Regardless")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CdmGetMeResponse:
        """Get the details of the currently logged in user.


        :param ignore_cache: Ignore the cache and retrieve from the Phylum Regardless
        :type ignore_cache: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_me_serialize(
            ignore_cache=ignore_cache,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmGetMeResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_me_with_http_info(
        self,
        ignore_cache: Annotated[Optional[StrictBool], Field(description="Ignore the cache and retrieve from the Phylum Regardless")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CdmGetMeResponse]:
        """Get the details of the currently logged in user.


        :param ignore_cache: Ignore the cache and retrieve from the Phylum Regardless
        :type ignore_cache: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_me_serialize(
            ignore_cache=ignore_cache,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmGetMeResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_me_without_preload_content(
        self,
        ignore_cache: Annotated[Optional[StrictBool], Field(description="Ignore the cache and retrieve from the Phylum Regardless")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the details of the currently logged in user.


        :param ignore_cache: Ignore the cache and retrieve from the Phylum Regardless
        :type ignore_cache: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_me_serialize(
            ignore_cache=ignore_cache,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmGetMeResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_me_serialize(
        self,
        ignore_cache,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if ignore_cache is not None:
            
            _query_params.append(('ignore_cache', ignore_cache))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/acre/user/me',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_user(
        self,
        user_details: Annotated[Optional[StrictBool], Field(description="Return the entire user details. By default this value is false, and only the firstname, lastname, email, ext_org_id, and IDs are returned.")] = None,
        filter_organisation_id: Annotated[Optional[StrictStr], Field(description="Only include users belonging to the specified organisation.")] = None,
        filter_group_id: Annotated[Optional[StrictStr], Field(description="Only include users with the specified group.")] = None,
        filter_organisation_ext_identifier: Annotated[Optional[StrictStr], Field(description="Only include users belonging to the organisation with the specified external identifier.")] = None,
        filter_ext_ids: Annotated[Optional[List[StrictStr]], Field(description="Only include users with the specified user external IDs. This filter must be used in conjunction with filter_ext_source.")] = None,
        filter_ext_source: Annotated[Optional[StrictStr], Field(description="Filtering by external source. This filter must be used in conjunction with filter_ext_ids.   - ONFIDO: Onfido (https://onfido.com/).")] = None,
        user_ids: Annotated[Optional[List[StrictStr]], Field(description="User IDs (optional, default wildcard for all IDs user can access). If specified, the request is not a wildcard and users are returned in the order that their IDs were specified. Otherwise, if not specified, the request is considered a wildcard and users are returned in the order that they were created.")] = None,
        bookmark: Annotated[Optional[StrictStr], Field(description="Opaque pagination bookmark. Set to the empty string (or omit) to begin.")] = None,
        filter_emails: Annotated[Optional[List[StrictStr]], Field(description="Only include users with the specified emails.")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Specify a limit on the number of items returned in a page. Values that are too large will be rejected. All requests are subject to the page size, which is 100 if not specified and can be specified up to 500.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CdmGetUserResponse:
        """Get the details of users.


        :param user_details: Return the entire user details. By default this value is false, and only the firstname, lastname, email, ext_org_id, and IDs are returned.
        :type user_details: bool
        :param filter_organisation_id: Only include users belonging to the specified organisation.
        :type filter_organisation_id: str
        :param filter_group_id: Only include users with the specified group.
        :type filter_group_id: str
        :param filter_organisation_ext_identifier: Only include users belonging to the organisation with the specified external identifier.
        :type filter_organisation_ext_identifier: str
        :param filter_ext_ids: Only include users with the specified user external IDs. This filter must be used in conjunction with filter_ext_source.
        :type filter_ext_ids: List[str]
        :param filter_ext_source: Filtering by external source. This filter must be used in conjunction with filter_ext_ids.   - ONFIDO: Onfido (https://onfido.com/).
        :type filter_ext_source: str
        :param user_ids: User IDs (optional, default wildcard for all IDs user can access). If specified, the request is not a wildcard and users are returned in the order that their IDs were specified. Otherwise, if not specified, the request is considered a wildcard and users are returned in the order that they were created.
        :type user_ids: List[str]
        :param bookmark: Opaque pagination bookmark. Set to the empty string (or omit) to begin.
        :type bookmark: str
        :param filter_emails: Only include users with the specified emails.
        :type filter_emails: List[str]
        :param page_size: Specify a limit on the number of items returned in a page. Values that are too large will be rejected. All requests are subject to the page size, which is 100 if not specified and can be specified up to 500.
        :type page_size: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_user_serialize(
            user_details=user_details,
            filter_organisation_id=filter_organisation_id,
            filter_group_id=filter_group_id,
            filter_organisation_ext_identifier=filter_organisation_ext_identifier,
            filter_ext_ids=filter_ext_ids,
            filter_ext_source=filter_ext_source,
            user_ids=user_ids,
            bookmark=bookmark,
            filter_emails=filter_emails,
            page_size=page_size,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmGetUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_user_with_http_info(
        self,
        user_details: Annotated[Optional[StrictBool], Field(description="Return the entire user details. By default this value is false, and only the firstname, lastname, email, ext_org_id, and IDs are returned.")] = None,
        filter_organisation_id: Annotated[Optional[StrictStr], Field(description="Only include users belonging to the specified organisation.")] = None,
        filter_group_id: Annotated[Optional[StrictStr], Field(description="Only include users with the specified group.")] = None,
        filter_organisation_ext_identifier: Annotated[Optional[StrictStr], Field(description="Only include users belonging to the organisation with the specified external identifier.")] = None,
        filter_ext_ids: Annotated[Optional[List[StrictStr]], Field(description="Only include users with the specified user external IDs. This filter must be used in conjunction with filter_ext_source.")] = None,
        filter_ext_source: Annotated[Optional[StrictStr], Field(description="Filtering by external source. This filter must be used in conjunction with filter_ext_ids.   - ONFIDO: Onfido (https://onfido.com/).")] = None,
        user_ids: Annotated[Optional[List[StrictStr]], Field(description="User IDs (optional, default wildcard for all IDs user can access). If specified, the request is not a wildcard and users are returned in the order that their IDs were specified. Otherwise, if not specified, the request is considered a wildcard and users are returned in the order that they were created.")] = None,
        bookmark: Annotated[Optional[StrictStr], Field(description="Opaque pagination bookmark. Set to the empty string (or omit) to begin.")] = None,
        filter_emails: Annotated[Optional[List[StrictStr]], Field(description="Only include users with the specified emails.")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Specify a limit on the number of items returned in a page. Values that are too large will be rejected. All requests are subject to the page size, which is 100 if not specified and can be specified up to 500.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CdmGetUserResponse]:
        """Get the details of users.


        :param user_details: Return the entire user details. By default this value is false, and only the firstname, lastname, email, ext_org_id, and IDs are returned.
        :type user_details: bool
        :param filter_organisation_id: Only include users belonging to the specified organisation.
        :type filter_organisation_id: str
        :param filter_group_id: Only include users with the specified group.
        :type filter_group_id: str
        :param filter_organisation_ext_identifier: Only include users belonging to the organisation with the specified external identifier.
        :type filter_organisation_ext_identifier: str
        :param filter_ext_ids: Only include users with the specified user external IDs. This filter must be used in conjunction with filter_ext_source.
        :type filter_ext_ids: List[str]
        :param filter_ext_source: Filtering by external source. This filter must be used in conjunction with filter_ext_ids.   - ONFIDO: Onfido (https://onfido.com/).
        :type filter_ext_source: str
        :param user_ids: User IDs (optional, default wildcard for all IDs user can access). If specified, the request is not a wildcard and users are returned in the order that their IDs were specified. Otherwise, if not specified, the request is considered a wildcard and users are returned in the order that they were created.
        :type user_ids: List[str]
        :param bookmark: Opaque pagination bookmark. Set to the empty string (or omit) to begin.
        :type bookmark: str
        :param filter_emails: Only include users with the specified emails.
        :type filter_emails: List[str]
        :param page_size: Specify a limit on the number of items returned in a page. Values that are too large will be rejected. All requests are subject to the page size, which is 100 if not specified and can be specified up to 500.
        :type page_size: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_user_serialize(
            user_details=user_details,
            filter_organisation_id=filter_organisation_id,
            filter_group_id=filter_group_id,
            filter_organisation_ext_identifier=filter_organisation_ext_identifier,
            filter_ext_ids=filter_ext_ids,
            filter_ext_source=filter_ext_source,
            user_ids=user_ids,
            bookmark=bookmark,
            filter_emails=filter_emails,
            page_size=page_size,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmGetUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_user_without_preload_content(
        self,
        user_details: Annotated[Optional[StrictBool], Field(description="Return the entire user details. By default this value is false, and only the firstname, lastname, email, ext_org_id, and IDs are returned.")] = None,
        filter_organisation_id: Annotated[Optional[StrictStr], Field(description="Only include users belonging to the specified organisation.")] = None,
        filter_group_id: Annotated[Optional[StrictStr], Field(description="Only include users with the specified group.")] = None,
        filter_organisation_ext_identifier: Annotated[Optional[StrictStr], Field(description="Only include users belonging to the organisation with the specified external identifier.")] = None,
        filter_ext_ids: Annotated[Optional[List[StrictStr]], Field(description="Only include users with the specified user external IDs. This filter must be used in conjunction with filter_ext_source.")] = None,
        filter_ext_source: Annotated[Optional[StrictStr], Field(description="Filtering by external source. This filter must be used in conjunction with filter_ext_ids.   - ONFIDO: Onfido (https://onfido.com/).")] = None,
        user_ids: Annotated[Optional[List[StrictStr]], Field(description="User IDs (optional, default wildcard for all IDs user can access). If specified, the request is not a wildcard and users are returned in the order that their IDs were specified. Otherwise, if not specified, the request is considered a wildcard and users are returned in the order that they were created.")] = None,
        bookmark: Annotated[Optional[StrictStr], Field(description="Opaque pagination bookmark. Set to the empty string (or omit) to begin.")] = None,
        filter_emails: Annotated[Optional[List[StrictStr]], Field(description="Only include users with the specified emails.")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Specify a limit on the number of items returned in a page. Values that are too large will be rejected. All requests are subject to the page size, which is 100 if not specified and can be specified up to 500.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the details of users.


        :param user_details: Return the entire user details. By default this value is false, and only the firstname, lastname, email, ext_org_id, and IDs are returned.
        :type user_details: bool
        :param filter_organisation_id: Only include users belonging to the specified organisation.
        :type filter_organisation_id: str
        :param filter_group_id: Only include users with the specified group.
        :type filter_group_id: str
        :param filter_organisation_ext_identifier: Only include users belonging to the organisation with the specified external identifier.
        :type filter_organisation_ext_identifier: str
        :param filter_ext_ids: Only include users with the specified user external IDs. This filter must be used in conjunction with filter_ext_source.
        :type filter_ext_ids: List[str]
        :param filter_ext_source: Filtering by external source. This filter must be used in conjunction with filter_ext_ids.   - ONFIDO: Onfido (https://onfido.com/).
        :type filter_ext_source: str
        :param user_ids: User IDs (optional, default wildcard for all IDs user can access). If specified, the request is not a wildcard and users are returned in the order that their IDs were specified. Otherwise, if not specified, the request is considered a wildcard and users are returned in the order that they were created.
        :type user_ids: List[str]
        :param bookmark: Opaque pagination bookmark. Set to the empty string (or omit) to begin.
        :type bookmark: str
        :param filter_emails: Only include users with the specified emails.
        :type filter_emails: List[str]
        :param page_size: Specify a limit on the number of items returned in a page. Values that are too large will be rejected. All requests are subject to the page size, which is 100 if not specified and can be specified up to 500.
        :type page_size: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_user_serialize(
            user_details=user_details,
            filter_organisation_id=filter_organisation_id,
            filter_group_id=filter_group_id,
            filter_organisation_ext_identifier=filter_organisation_ext_identifier,
            filter_ext_ids=filter_ext_ids,
            filter_ext_source=filter_ext_source,
            user_ids=user_ids,
            bookmark=bookmark,
            filter_emails=filter_emails,
            page_size=page_size,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmGetUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_user_serialize(
        self,
        user_details,
        filter_organisation_id,
        filter_group_id,
        filter_organisation_ext_identifier,
        filter_ext_ids,
        filter_ext_source,
        user_ids,
        bookmark,
        filter_emails,
        page_size,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filter_ext_ids': 'multi',
            'user_ids': 'multi',
            'filter_emails': 'multi',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if user_details is not None:
            
            _query_params.append(('user_details', user_details))
            
        if filter_organisation_id is not None:
            
            _query_params.append(('filter_organisation_id', filter_organisation_id))
            
        if filter_group_id is not None:
            
            _query_params.append(('filter_group_id', filter_group_id))
            
        if filter_organisation_ext_identifier is not None:
            
            _query_params.append(('filter_organisation_ext_identifier', filter_organisation_ext_identifier))
            
        if filter_ext_ids is not None:
            
            _query_params.append(('filter_ext_ids', filter_ext_ids))
            
        if filter_ext_source is not None:
            
            _query_params.append(('filter_ext_source', filter_ext_source))
            
        if user_ids is not None:
            
            _query_params.append(('user_ids', user_ids))
            
        if bookmark is not None:
            
            _query_params.append(('bookmark', bookmark))
            
        if filter_emails is not None:
            
            _query_params.append(('filter_emails', filter_emails))
            
        if page_size is not None:
            
            _query_params.append(('page_size', page_size))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/acre/user',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def replace_user(
        self,
        user_user_id: Annotated[StrictStr, Field(description="User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary.")],
        user: Annotated[FullDetailsOfTheUserToBeReplacedRequired, Field(description="Full details of the user to be replaced. Required.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CdmReplaceUserResponse:
        """Replace (PUT) an existing user.


        :param user_user_id: User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary. (required)
        :type user_user_id: str
        :param user: Full details of the user to be replaced. Required. (required)
        :type user: FullDetailsOfTheUserToBeReplacedRequired
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._replace_user_serialize(
            user_user_id=user_user_id,
            user=user,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmReplaceUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def replace_user_with_http_info(
        self,
        user_user_id: Annotated[StrictStr, Field(description="User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary.")],
        user: Annotated[FullDetailsOfTheUserToBeReplacedRequired, Field(description="Full details of the user to be replaced. Required.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CdmReplaceUserResponse]:
        """Replace (PUT) an existing user.


        :param user_user_id: User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary. (required)
        :type user_user_id: str
        :param user: Full details of the user to be replaced. Required. (required)
        :type user: FullDetailsOfTheUserToBeReplacedRequired
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._replace_user_serialize(
            user_user_id=user_user_id,
            user=user,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmReplaceUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def replace_user_without_preload_content(
        self,
        user_user_id: Annotated[StrictStr, Field(description="User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary.")],
        user: Annotated[FullDetailsOfTheUserToBeReplacedRequired, Field(description="Full details of the user to be replaced. Required.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Replace (PUT) an existing user.


        :param user_user_id: User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary. (required)
        :type user_user_id: str
        :param user: Full details of the user to be replaced. Required. (required)
        :type user: FullDetailsOfTheUserToBeReplacedRequired
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._replace_user_serialize(
            user_user_id=user_user_id,
            user=user,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmReplaceUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _replace_user_serialize(
        self,
        user_user_id,
        user,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if user_user_id is not None:
            _path_params['user.user_id'] = user_user_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if user is not None:
            _body_params = user


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/v1/acre/user/{user.user_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def update_user(
        self,
        user_user_id: Annotated[StrictStr, Field(description="User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary.")],
        user: Annotated[PartialDetailsOfTheUserToBePatchedRequired, Field(description="Partial details of the user to be patched. Required.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CdmUpdateUserResponse:
        """Update (PATCH) an existing user.


        :param user_user_id: User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary. (required)
        :type user_user_id: str
        :param user: Partial details of the user to be patched. Required. (required)
        :type user: PartialDetailsOfTheUserToBePatchedRequired
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_user_serialize(
            user_user_id=user_user_id,
            user=user,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmUpdateUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def update_user_with_http_info(
        self,
        user_user_id: Annotated[StrictStr, Field(description="User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary.")],
        user: Annotated[PartialDetailsOfTheUserToBePatchedRequired, Field(description="Partial details of the user to be patched. Required.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CdmUpdateUserResponse]:
        """Update (PATCH) an existing user.


        :param user_user_id: User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary. (required)
        :type user_user_id: str
        :param user: Partial details of the user to be patched. Required. (required)
        :type user: PartialDetailsOfTheUserToBePatchedRequired
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_user_serialize(
            user_user_id=user_user_id,
            user=user,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmUpdateUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def update_user_without_preload_content(
        self,
        user_user_id: Annotated[StrictStr, Field(description="User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary.")],
        user: Annotated[PartialDetailsOfTheUserToBePatchedRequired, Field(description="Partial details of the user to be patched. Required.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update (PATCH) an existing user.


        :param user_user_id: User reference. **IMPORTANT:** This field cannot be updated and is populated automatically. Included in summary. (required)
        :type user_user_id: str
        :param user: Partial details of the user to be patched. Required. (required)
        :type user: PartialDetailsOfTheUserToBePatchedRequired
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), 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
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_user_serialize(
            user_user_id=user_user_id,
            user=user,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CdmUpdateUserResponse",
            '400': "V1ExceptionResponse",
            '401': "V1ExceptionResponse",
            '403': "V1ExceptionResponse",
            '404': "V1ExceptionResponse",
            '405': "str",
            '500': "V1ExceptionResponse",
            '503': "V1ExceptionResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _update_user_serialize(
        self,
        user_user_id,
        user,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if user_user_id is not None:
            _path_params['user.user_id'] = user_user_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if user is not None:
            _body_params = user


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='PATCH',
            resource_path='/v1/acre/user/{user.user_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


