# coding: utf-8

"""
    BioT Settings Service

    APIs document description for Settings service

    The version of the OpenAPI document: 2.44.1
    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
from typing import Optional
from typing_extensions import Annotated
from uuid import UUID
from biotmed_settings_sdk.models.create_template_request import CreateTemplateRequest
from biotmed_settings_sdk.models.get_template_response import GetTemplateResponse
from biotmed_settings_sdk.models.search_request_v2 import SearchRequestV2
from biotmed_settings_sdk.models.search_response_get_template_response import SearchResponseGetTemplateResponse
from biotmed_settings_sdk.models.search_response_template_minimized_response import SearchResponseTemplateMinimizedResponse
from biotmed_settings_sdk.models.template_overview_response import TemplateOverviewResponse
from biotmed_settings_sdk.models.update_template_request import UpdateTemplateRequest

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


class TemplateAPIApi:
    """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_template(
        self,
        create_template_request: CreateTemplateRequest,
        force: Annotated[Optional[StrictBool], Field(description="Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.")] = 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,
    ) -> GetTemplateResponse:
        """Create a new Template

        Create a new Template    (*)This parameter is mandatory only if its optional parent attribute is defined. Click <a href=\"https://docs.biot-med.com/docs/biot-rest-api#api-optional-parameters\" target=\"_blank\">here</a> for more information.  Request Body Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |displayName|string|true||| |name|string|true| Pattern:[a-zA-Z]\\w*|| |description|string|false||| |ownerOrganizationId|string|false||| |analyticsDbConfiguration|object|false||| |analyticsDbConfiguration.name|string|false||| |customAttributes|array|false||| |customAttributes[index]|array|false||| |customAttributes[index].displayName|string|true(*)||| |customAttributes[index].phi|boolean|false||| |customAttributes[index].referenceConfiguration|object|false||| |customAttributes[index].referenceConfiguration.uniquely|boolean|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |customAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |customAttributes[index].referenceConfiguration.entityType|string|true(*)||| |customAttributes[index].linkConfiguration|object|false||| |customAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |customAttributes[index].linkConfiguration.templateId|string|true(*)||| |customAttributes[index].linkConfiguration.attributeId|string|true(*)||| |customAttributes[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].type|string|true(*)| Values:LABEL,PARAGRAPH,INTEGER,DECIMAL,BOOLEAN,SINGLE_SELECT,MULTI_SELECT,ADDRESS,NAME,PHONE,EMAIL,DATE_TIME,DATE,REFERENCE,TIMEZONE,LOCALE,FILE,IMAGE,LINK,WAVEFORM|| |customAttributes[index].validation|object|false||| |customAttributes[index].validation.mandatory|boolean|true(*)||| |customAttributes[index].validation.defaultValue|object|false||| |customAttributes[index].validation.min|number|false||| |customAttributes[index].validation.max|number|false||| |customAttributes[index].validation.regex|string|false||| |customAttributes[index].numericMetaData|object|false||| |customAttributes[index].numericMetaData.units|string|false||| |customAttributes[index].numericMetaData.upperRange|number|false||| |customAttributes[index].numericMetaData.lowerRange|number|false||| |customAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |customAttributes[index].analyticsDbConfiguration|object|false||| |customAttributes[index].analyticsDbConfiguration.name|string|false||| |customAttributes[index].selectableValues|array|false||| |customAttributes[index].selectableValues[index]|array|false||| |customAttributes[index].selectableValues[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].selectableValues[index].displayName|string|true(*)||| |customAttributes[index].category|string|true(*)||| |builtInAttributes|array|false||| |builtInAttributes[index]|array|false||| |builtInAttributes[index].name|string|true(*)||| |builtInAttributes[index].basePath|string|false||| |builtInAttributes[index].displayName|string|true(*)||| |builtInAttributes[index].phi|boolean|false||| |builtInAttributes[index].referenceConfiguration|object|false||| |builtInAttributes[index].referenceConfiguration.uniquely|boolean|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |builtInAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |builtInAttributes[index].referenceConfiguration.entityType|string|true(*)||| |builtInAttributes[index].linkConfiguration|object|false||| |builtInAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |builtInAttributes[index].linkConfiguration.templateId|string|true(*)||| |builtInAttributes[index].linkConfiguration.attributeId|string|true(*)||| |builtInAttributes[index].validation|object|false||| |builtInAttributes[index].validation.mandatory|boolean|true(*)||| |builtInAttributes[index].validation.defaultValue|object|false||| |builtInAttributes[index].validation.min|number|false||| |builtInAttributes[index].validation.max|number|false||| |builtInAttributes[index].validation.regex|string|false||| |builtInAttributes[index].numericMetaData|object|false||| |builtInAttributes[index].numericMetaData.units|string|false||| |builtInAttributes[index].numericMetaData.upperRange|number|false||| |builtInAttributes[index].numericMetaData.lowerRange|number|false||| |builtInAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |templateAttributes|array|false||| |templateAttributes[index]|array|false||| |templateAttributes[index].name|string|true(*)||| |templateAttributes[index].basePath|string|false||| |templateAttributes[index].displayName|string|true(*)||| |templateAttributes[index].phi|boolean|false||| |templateAttributes[index].referenceConfiguration|object|false||| |templateAttributes[index].referenceConfiguration.uniquely|boolean|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |templateAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |templateAttributes[index].referenceConfiguration.entityType|string|true(*)||| |templateAttributes[index].linkConfiguration|object|false||| |templateAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |templateAttributes[index].linkConfiguration.templateId|string|true(*)||| |templateAttributes[index].linkConfiguration.attributeId|string|true(*)||| |templateAttributes[index].value|object|false||| |templateAttributes[index].organizationSelectionConfiguration|object|false||| |templateAttributes[index].organizationSelectionConfiguration.selected|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index]|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index].id|string|true(*)||| |templateAttributes[index].organizationSelectionConfiguration.all|boolean|false||| |entityType|string|true||| |parentTemplateId|string|false||| Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |force|boolean|false|Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.|true|   This API requires **SETTINGS_CREATE_TEMPLATE** permission(s).  

        :param create_template_request: (required)
        :type create_template_request: CreateTemplateRequest
        :param force: Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.
        :type force: 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._create_template_serialize(
            create_template_request=create_template_request,
            force=force,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '201': "GetTemplateResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
            '409': "ErrorResponse",
        }
        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_template_with_http_info(
        self,
        create_template_request: CreateTemplateRequest,
        force: Annotated[Optional[StrictBool], Field(description="Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.")] = 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[GetTemplateResponse]:
        """Create a new Template

        Create a new Template    (*)This parameter is mandatory only if its optional parent attribute is defined. Click <a href=\"https://docs.biot-med.com/docs/biot-rest-api#api-optional-parameters\" target=\"_blank\">here</a> for more information.  Request Body Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |displayName|string|true||| |name|string|true| Pattern:[a-zA-Z]\\w*|| |description|string|false||| |ownerOrganizationId|string|false||| |analyticsDbConfiguration|object|false||| |analyticsDbConfiguration.name|string|false||| |customAttributes|array|false||| |customAttributes[index]|array|false||| |customAttributes[index].displayName|string|true(*)||| |customAttributes[index].phi|boolean|false||| |customAttributes[index].referenceConfiguration|object|false||| |customAttributes[index].referenceConfiguration.uniquely|boolean|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |customAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |customAttributes[index].referenceConfiguration.entityType|string|true(*)||| |customAttributes[index].linkConfiguration|object|false||| |customAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |customAttributes[index].linkConfiguration.templateId|string|true(*)||| |customAttributes[index].linkConfiguration.attributeId|string|true(*)||| |customAttributes[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].type|string|true(*)| Values:LABEL,PARAGRAPH,INTEGER,DECIMAL,BOOLEAN,SINGLE_SELECT,MULTI_SELECT,ADDRESS,NAME,PHONE,EMAIL,DATE_TIME,DATE,REFERENCE,TIMEZONE,LOCALE,FILE,IMAGE,LINK,WAVEFORM|| |customAttributes[index].validation|object|false||| |customAttributes[index].validation.mandatory|boolean|true(*)||| |customAttributes[index].validation.defaultValue|object|false||| |customAttributes[index].validation.min|number|false||| |customAttributes[index].validation.max|number|false||| |customAttributes[index].validation.regex|string|false||| |customAttributes[index].numericMetaData|object|false||| |customAttributes[index].numericMetaData.units|string|false||| |customAttributes[index].numericMetaData.upperRange|number|false||| |customAttributes[index].numericMetaData.lowerRange|number|false||| |customAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |customAttributes[index].analyticsDbConfiguration|object|false||| |customAttributes[index].analyticsDbConfiguration.name|string|false||| |customAttributes[index].selectableValues|array|false||| |customAttributes[index].selectableValues[index]|array|false||| |customAttributes[index].selectableValues[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].selectableValues[index].displayName|string|true(*)||| |customAttributes[index].category|string|true(*)||| |builtInAttributes|array|false||| |builtInAttributes[index]|array|false||| |builtInAttributes[index].name|string|true(*)||| |builtInAttributes[index].basePath|string|false||| |builtInAttributes[index].displayName|string|true(*)||| |builtInAttributes[index].phi|boolean|false||| |builtInAttributes[index].referenceConfiguration|object|false||| |builtInAttributes[index].referenceConfiguration.uniquely|boolean|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |builtInAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |builtInAttributes[index].referenceConfiguration.entityType|string|true(*)||| |builtInAttributes[index].linkConfiguration|object|false||| |builtInAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |builtInAttributes[index].linkConfiguration.templateId|string|true(*)||| |builtInAttributes[index].linkConfiguration.attributeId|string|true(*)||| |builtInAttributes[index].validation|object|false||| |builtInAttributes[index].validation.mandatory|boolean|true(*)||| |builtInAttributes[index].validation.defaultValue|object|false||| |builtInAttributes[index].validation.min|number|false||| |builtInAttributes[index].validation.max|number|false||| |builtInAttributes[index].validation.regex|string|false||| |builtInAttributes[index].numericMetaData|object|false||| |builtInAttributes[index].numericMetaData.units|string|false||| |builtInAttributes[index].numericMetaData.upperRange|number|false||| |builtInAttributes[index].numericMetaData.lowerRange|number|false||| |builtInAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |templateAttributes|array|false||| |templateAttributes[index]|array|false||| |templateAttributes[index].name|string|true(*)||| |templateAttributes[index].basePath|string|false||| |templateAttributes[index].displayName|string|true(*)||| |templateAttributes[index].phi|boolean|false||| |templateAttributes[index].referenceConfiguration|object|false||| |templateAttributes[index].referenceConfiguration.uniquely|boolean|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |templateAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |templateAttributes[index].referenceConfiguration.entityType|string|true(*)||| |templateAttributes[index].linkConfiguration|object|false||| |templateAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |templateAttributes[index].linkConfiguration.templateId|string|true(*)||| |templateAttributes[index].linkConfiguration.attributeId|string|true(*)||| |templateAttributes[index].value|object|false||| |templateAttributes[index].organizationSelectionConfiguration|object|false||| |templateAttributes[index].organizationSelectionConfiguration.selected|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index]|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index].id|string|true(*)||| |templateAttributes[index].organizationSelectionConfiguration.all|boolean|false||| |entityType|string|true||| |parentTemplateId|string|false||| Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |force|boolean|false|Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.|true|   This API requires **SETTINGS_CREATE_TEMPLATE** permission(s).  

        :param create_template_request: (required)
        :type create_template_request: CreateTemplateRequest
        :param force: Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.
        :type force: 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._create_template_serialize(
            create_template_request=create_template_request,
            force=force,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '201': "GetTemplateResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
            '409': "ErrorResponse",
        }
        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_template_without_preload_content(
        self,
        create_template_request: CreateTemplateRequest,
        force: Annotated[Optional[StrictBool], Field(description="Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.")] = 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:
        """Create a new Template

        Create a new Template    (*)This parameter is mandatory only if its optional parent attribute is defined. Click <a href=\"https://docs.biot-med.com/docs/biot-rest-api#api-optional-parameters\" target=\"_blank\">here</a> for more information.  Request Body Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |displayName|string|true||| |name|string|true| Pattern:[a-zA-Z]\\w*|| |description|string|false||| |ownerOrganizationId|string|false||| |analyticsDbConfiguration|object|false||| |analyticsDbConfiguration.name|string|false||| |customAttributes|array|false||| |customAttributes[index]|array|false||| |customAttributes[index].displayName|string|true(*)||| |customAttributes[index].phi|boolean|false||| |customAttributes[index].referenceConfiguration|object|false||| |customAttributes[index].referenceConfiguration.uniquely|boolean|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |customAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |customAttributes[index].referenceConfiguration.entityType|string|true(*)||| |customAttributes[index].linkConfiguration|object|false||| |customAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |customAttributes[index].linkConfiguration.templateId|string|true(*)||| |customAttributes[index].linkConfiguration.attributeId|string|true(*)||| |customAttributes[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].type|string|true(*)| Values:LABEL,PARAGRAPH,INTEGER,DECIMAL,BOOLEAN,SINGLE_SELECT,MULTI_SELECT,ADDRESS,NAME,PHONE,EMAIL,DATE_TIME,DATE,REFERENCE,TIMEZONE,LOCALE,FILE,IMAGE,LINK,WAVEFORM|| |customAttributes[index].validation|object|false||| |customAttributes[index].validation.mandatory|boolean|true(*)||| |customAttributes[index].validation.defaultValue|object|false||| |customAttributes[index].validation.min|number|false||| |customAttributes[index].validation.max|number|false||| |customAttributes[index].validation.regex|string|false||| |customAttributes[index].numericMetaData|object|false||| |customAttributes[index].numericMetaData.units|string|false||| |customAttributes[index].numericMetaData.upperRange|number|false||| |customAttributes[index].numericMetaData.lowerRange|number|false||| |customAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |customAttributes[index].analyticsDbConfiguration|object|false||| |customAttributes[index].analyticsDbConfiguration.name|string|false||| |customAttributes[index].selectableValues|array|false||| |customAttributes[index].selectableValues[index]|array|false||| |customAttributes[index].selectableValues[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].selectableValues[index].displayName|string|true(*)||| |customAttributes[index].category|string|true(*)||| |builtInAttributes|array|false||| |builtInAttributes[index]|array|false||| |builtInAttributes[index].name|string|true(*)||| |builtInAttributes[index].basePath|string|false||| |builtInAttributes[index].displayName|string|true(*)||| |builtInAttributes[index].phi|boolean|false||| |builtInAttributes[index].referenceConfiguration|object|false||| |builtInAttributes[index].referenceConfiguration.uniquely|boolean|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |builtInAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |builtInAttributes[index].referenceConfiguration.entityType|string|true(*)||| |builtInAttributes[index].linkConfiguration|object|false||| |builtInAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |builtInAttributes[index].linkConfiguration.templateId|string|true(*)||| |builtInAttributes[index].linkConfiguration.attributeId|string|true(*)||| |builtInAttributes[index].validation|object|false||| |builtInAttributes[index].validation.mandatory|boolean|true(*)||| |builtInAttributes[index].validation.defaultValue|object|false||| |builtInAttributes[index].validation.min|number|false||| |builtInAttributes[index].validation.max|number|false||| |builtInAttributes[index].validation.regex|string|false||| |builtInAttributes[index].numericMetaData|object|false||| |builtInAttributes[index].numericMetaData.units|string|false||| |builtInAttributes[index].numericMetaData.upperRange|number|false||| |builtInAttributes[index].numericMetaData.lowerRange|number|false||| |builtInAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |templateAttributes|array|false||| |templateAttributes[index]|array|false||| |templateAttributes[index].name|string|true(*)||| |templateAttributes[index].basePath|string|false||| |templateAttributes[index].displayName|string|true(*)||| |templateAttributes[index].phi|boolean|false||| |templateAttributes[index].referenceConfiguration|object|false||| |templateAttributes[index].referenceConfiguration.uniquely|boolean|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |templateAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |templateAttributes[index].referenceConfiguration.entityType|string|true(*)||| |templateAttributes[index].linkConfiguration|object|false||| |templateAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |templateAttributes[index].linkConfiguration.templateId|string|true(*)||| |templateAttributes[index].linkConfiguration.attributeId|string|true(*)||| |templateAttributes[index].value|object|false||| |templateAttributes[index].organizationSelectionConfiguration|object|false||| |templateAttributes[index].organizationSelectionConfiguration.selected|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index]|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index].id|string|true(*)||| |templateAttributes[index].organizationSelectionConfiguration.all|boolean|false||| |entityType|string|true||| |parentTemplateId|string|false||| Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |force|boolean|false|Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.|true|   This API requires **SETTINGS_CREATE_TEMPLATE** permission(s).  

        :param create_template_request: (required)
        :type create_template_request: CreateTemplateRequest
        :param force: Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.
        :type force: 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._create_template_serialize(
            create_template_request=create_template_request,
            force=force,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '201': "GetTemplateResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
            '409': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _create_template_serialize(
        self,
        create_template_request,
        force,
        _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 force is not None:
            
            _query_params.append(('force', force))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if create_template_request is not None:
            _body_params = create_template_request


        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/templates',
            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 delete_template(
        self,
        template_id: UUID,
        force: Annotated[Optional[StrictBool], Field(description="Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.")] = 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,
    ) -> None:
        """Delete Template

        Delete Template    Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null|| Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |force|boolean|false|Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.|true|   This API requires **SETTINGS_DELETE_TEMPLATE** permission(s).  

        :param template_id: (required)
        :type template_id: UUID
        :param force: Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.
        :type force: 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._delete_template_serialize(
            template_id=template_id,
            force=force,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '204': None,
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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 delete_template_with_http_info(
        self,
        template_id: UUID,
        force: Annotated[Optional[StrictBool], Field(description="Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.")] = 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[None]:
        """Delete Template

        Delete Template    Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null|| Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |force|boolean|false|Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.|true|   This API requires **SETTINGS_DELETE_TEMPLATE** permission(s).  

        :param template_id: (required)
        :type template_id: UUID
        :param force: Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.
        :type force: 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._delete_template_serialize(
            template_id=template_id,
            force=force,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '204': None,
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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 delete_template_without_preload_content(
        self,
        template_id: UUID,
        force: Annotated[Optional[StrictBool], Field(description="Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.")] = 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:
        """Delete Template

        Delete Template    Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null|| Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |force|boolean|false|Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.|true|   This API requires **SETTINGS_DELETE_TEMPLATE** permission(s).  

        :param template_id: (required)
        :type template_id: UUID
        :param force: Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode.
        :type force: 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._delete_template_serialize(
            template_id=template_id,
            force=force,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '204': None,
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _delete_template_serialize(
        self,
        template_id,
        force,
        _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 template_id is not None:
            _path_params['templateId'] = template_id
        # process the query parameters
        if force is not None:
            
            _query_params.append(('force', force))
            
        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/v1/templates/{templateId}',
            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_template(
        self,
        template_id: UUID,
        _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,
    ) -> GetTemplateResponse:
        """Get Template by ID

        Get Template by ID    Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null||   This API requires **SETTINGS_GET_TEMPLATE** permission(s).  

        :param template_id: (required)
        :type template_id: UUID
        :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_template_serialize(
            template_id=template_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "GetTemplateResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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_template_with_http_info(
        self,
        template_id: UUID,
        _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[GetTemplateResponse]:
        """Get Template by ID

        Get Template by ID    Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null||   This API requires **SETTINGS_GET_TEMPLATE** permission(s).  

        :param template_id: (required)
        :type template_id: UUID
        :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_template_serialize(
            template_id=template_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "GetTemplateResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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_template_without_preload_content(
        self,
        template_id: UUID,
        _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 Template by ID

        Get Template by ID    Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null||   This API requires **SETTINGS_GET_TEMPLATE** permission(s).  

        :param template_id: (required)
        :type template_id: UUID
        :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_template_serialize(
            template_id=template_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _get_template_serialize(
        self,
        template_id,
        _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 template_id is not None:
            _path_params['templateId'] = template_id
        # process the query parameters
        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/templates/{templateId}',
            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_template_overview(
        self,
        template_id: UUID,
        _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,
    ) -> TemplateOverviewResponse:
        """Get template overview

        Get template overview    Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null||   This API requires **SETTINGS_GET_TEMPLATE_OVERVIEW** permission(s).  

        :param template_id: (required)
        :type template_id: UUID
        :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_template_overview_serialize(
            template_id=template_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "TemplateOverviewResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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_template_overview_with_http_info(
        self,
        template_id: UUID,
        _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[TemplateOverviewResponse]:
        """Get template overview

        Get template overview    Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null||   This API requires **SETTINGS_GET_TEMPLATE_OVERVIEW** permission(s).  

        :param template_id: (required)
        :type template_id: UUID
        :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_template_overview_serialize(
            template_id=template_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "TemplateOverviewResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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_template_overview_without_preload_content(
        self,
        template_id: UUID,
        _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 template overview

        Get template overview    Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null||   This API requires **SETTINGS_GET_TEMPLATE_OVERVIEW** permission(s).  

        :param template_id: (required)
        :type template_id: UUID
        :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_template_overview_serialize(
            template_id=template_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _get_template_overview_serialize(
        self,
        template_id,
        _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 template_id is not None:
            _path_params['templateId'] = template_id
        # process the query parameters
        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/templates/{templateId}/overview',
            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 minimal_search(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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,
    ) -> SearchResponseTemplateMinimizedResponse:
        """Search Template entities by filter

        Search Template entities by filter  Returns list of Template, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *id*,*name*,*entityTypeName, parentTemplateId*,*parentTemplate.id*,*ownerOrganizationId*,*analyticsDbConfiguration.name* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *id*,*entityTypeName*,*creationTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Returns Minimized search response  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_MINIMIZED_SEARCH_TEMPLATE** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._minimal_search_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseTemplateMinimizedResponse",
        }
        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 minimal_search_with_http_info(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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[SearchResponseTemplateMinimizedResponse]:
        """Search Template entities by filter

        Search Template entities by filter  Returns list of Template, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *id*,*name*,*entityTypeName, parentTemplateId*,*parentTemplate.id*,*ownerOrganizationId*,*analyticsDbConfiguration.name* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *id*,*entityTypeName*,*creationTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Returns Minimized search response  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_MINIMIZED_SEARCH_TEMPLATE** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._minimal_search_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseTemplateMinimizedResponse",
        }
        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 minimal_search_without_preload_content(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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:
        """Search Template entities by filter

        Search Template entities by filter  Returns list of Template, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *id*,*name*,*entityTypeName, parentTemplateId*,*parentTemplate.id*,*ownerOrganizationId*,*analyticsDbConfiguration.name* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *id*,*entityTypeName*,*creationTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Returns Minimized search response  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_MINIMIZED_SEARCH_TEMPLATE** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._minimal_search_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseTemplateMinimizedResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _minimal_search_serialize(
        self,
        search_request,
        _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 search_request is not None:
            
            _query_params.append(('searchRequest', search_request))
            
        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/templates/minimized',
            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 search1(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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,
    ) -> SearchResponseGetTemplateResponse:
        """Search Template entities by filter

        Search Template entities by filter  Returns list of Template, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *id*,*name*,*entityTypeName*,*parentTemplateId*,*ownerOrganizationId*,*parentTemplate.id*,*analyticsDbConfiguration.name* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *id*,*entityTypeName*,*creationTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_TEMPLATE** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._search1_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseGetTemplateResponse",
        }
        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 search1_with_http_info(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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[SearchResponseGetTemplateResponse]:
        """Search Template entities by filter

        Search Template entities by filter  Returns list of Template, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *id*,*name*,*entityTypeName*,*parentTemplateId*,*ownerOrganizationId*,*parentTemplate.id*,*analyticsDbConfiguration.name* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *id*,*entityTypeName*,*creationTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_TEMPLATE** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._search1_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseGetTemplateResponse",
        }
        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 search1_without_preload_content(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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:
        """Search Template entities by filter

        Search Template entities by filter  Returns list of Template, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *id*,*name*,*entityTypeName*,*parentTemplateId*,*ownerOrganizationId*,*parentTemplate.id*,*analyticsDbConfiguration.name* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *id*,*entityTypeName*,*creationTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_TEMPLATE** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._search1_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseGetTemplateResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _search1_serialize(
        self,
        search_request,
        _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 search_request is not None:
            
            _query_params.append(('searchRequest', search_request))
            
        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/templates',
            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_template(
        self,
        update_template_request: UpdateTemplateRequest,
        template_id: UUID,
        force: Annotated[Optional[StrictBool], Field(description="Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode. If 'force' is not provided fallback is the 'forceUpdate' value inside 'templateRequest'")] = 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,
    ) -> GetTemplateResponse:
        """Update Template

        Update Template  Performs full update, the values will be replaced with values that are specified in the request  Important notice: This is a full update API (PUT), all existing attributes must be specified in the request body. Attributes that are not specified will be deleted from the updated record (receive a NULL value).  (*)This parameter is mandatory only if its optional parent attribute is defined. Click <a href=\"https://docs.biot-med.com/docs/biot-rest-api#api-optional-parameters\" target=\"_blank\">here</a> for more information.  Request Body Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |displayName|string|true||| |name|string|true| Pattern:[a-zA-Z]\\w*|| |description|string|false||| |ownerOrganizationId|string|false||| |analyticsDbConfiguration|object|false||| |analyticsDbConfiguration.name|string|false||| |forceUpdate|boolean|false||| |customAttributes|array|false||| |customAttributes[index]|array|false||| |customAttributes[index].displayName|string|true(*)||| |customAttributes[index].phi|boolean|false||| |customAttributes[index].referenceConfiguration|object|false||| |customAttributes[index].referenceConfiguration.uniquely|boolean|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |customAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |customAttributes[index].referenceConfiguration.entityType|string|true(*)||| |customAttributes[index].linkConfiguration|object|false||| |customAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |customAttributes[index].linkConfiguration.templateId|string|true(*)||| |customAttributes[index].linkConfiguration.attributeId|string|true(*)||| |customAttributes[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].type|string|true(*)| Values:LABEL,PARAGRAPH,INTEGER,DECIMAL,BOOLEAN,SINGLE_SELECT,MULTI_SELECT,ADDRESS,NAME,PHONE,EMAIL,DATE_TIME,DATE,REFERENCE,TIMEZONE,LOCALE,FILE,IMAGE,LINK,WAVEFORM|| |customAttributes[index].validation|object|false||| |customAttributes[index].validation.mandatory|boolean|true(*)||| |customAttributes[index].validation.defaultValue|object|false||| |customAttributes[index].validation.min|number|false||| |customAttributes[index].validation.max|number|false||| |customAttributes[index].validation.regex|string|false||| |customAttributes[index].numericMetaData|object|false||| |customAttributes[index].numericMetaData.units|string|false||| |customAttributes[index].numericMetaData.upperRange|number|false||| |customAttributes[index].numericMetaData.lowerRange|number|false||| |customAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |customAttributes[index].analyticsDbConfiguration|object|false||| |customAttributes[index].analyticsDbConfiguration.name|string|false||| |customAttributes[index].id|string|false||| |customAttributes[index].selectableValues|array|false||| |customAttributes[index].selectableValues[index]|array|false||| |customAttributes[index].selectableValues[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].selectableValues[index].displayName|string|true(*)||| |customAttributes[index].selectableValues[index].id|string|false||| |customAttributes[index].category|string|true(*)||| |builtInAttributes|array|false||| |builtInAttributes[index]|array|false||| |builtInAttributes[index].id|string|true(*)||| |builtInAttributes[index].displayName|string|true(*)||| |builtInAttributes[index].phi|boolean|false||| |builtInAttributes[index].referenceConfiguration|object|false||| |builtInAttributes[index].referenceConfiguration.uniquely|boolean|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |builtInAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |builtInAttributes[index].referenceConfiguration.entityType|string|true(*)||| |builtInAttributes[index].linkConfiguration|object|false||| |builtInAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |builtInAttributes[index].linkConfiguration.templateId|string|true(*)||| |builtInAttributes[index].linkConfiguration.attributeId|string|true(*)||| |builtInAttributes[index].validation|object|false||| |builtInAttributes[index].validation.mandatory|boolean|true(*)||| |builtInAttributes[index].validation.defaultValue|object|false||| |builtInAttributes[index].validation.min|number|false||| |builtInAttributes[index].validation.max|number|false||| |builtInAttributes[index].validation.regex|string|false||| |builtInAttributes[index].numericMetaData|object|false||| |builtInAttributes[index].numericMetaData.units|string|false||| |builtInAttributes[index].numericMetaData.upperRange|number|false||| |builtInAttributes[index].numericMetaData.lowerRange|number|false||| |builtInAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |templateAttributes|array|false||| |templateAttributes[index]|array|false||| |templateAttributes[index].id|string|true(*)||| |templateAttributes[index].displayName|string|true(*)||| |templateAttributes[index].phi|boolean|false||| |templateAttributes[index].referenceConfiguration|object|false||| |templateAttributes[index].referenceConfiguration.uniquely|boolean|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |templateAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |templateAttributes[index].referenceConfiguration.entityType|string|true(*)||| |templateAttributes[index].linkConfiguration|object|false||| |templateAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |templateAttributes[index].linkConfiguration.templateId|string|true(*)||| |templateAttributes[index].linkConfiguration.attributeId|string|true(*)||| |templateAttributes[index].value|object|false||| |templateAttributes[index].organizationSelectionConfiguration|object|false||| |templateAttributes[index].organizationSelectionConfiguration.selected|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index]|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index].id|string|true(*)||| |templateAttributes[index].organizationSelectionConfiguration.all|boolean|false||| |parentTemplateId|string|false||| Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null|| Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |force|boolean|false|Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode. If 'force' is not provided fallback is the 'forceUpdate' value inside 'templateRequest'|true|   This API requires **SETTINGS_UPDATE_TEMPLATE** permission(s).  

        :param update_template_request: (required)
        :type update_template_request: UpdateTemplateRequest
        :param template_id: (required)
        :type template_id: UUID
        :param force: Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode. If 'force' is not provided fallback is the 'forceUpdate' value inside 'templateRequest'
        :type force: 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._update_template_serialize(
            update_template_request=update_template_request,
            template_id=template_id,
            force=force,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "GetTemplateResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
            '409': "ErrorResponse",
        }
        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_template_with_http_info(
        self,
        update_template_request: UpdateTemplateRequest,
        template_id: UUID,
        force: Annotated[Optional[StrictBool], Field(description="Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode. If 'force' is not provided fallback is the 'forceUpdate' value inside 'templateRequest'")] = 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[GetTemplateResponse]:
        """Update Template

        Update Template  Performs full update, the values will be replaced with values that are specified in the request  Important notice: This is a full update API (PUT), all existing attributes must be specified in the request body. Attributes that are not specified will be deleted from the updated record (receive a NULL value).  (*)This parameter is mandatory only if its optional parent attribute is defined. Click <a href=\"https://docs.biot-med.com/docs/biot-rest-api#api-optional-parameters\" target=\"_blank\">here</a> for more information.  Request Body Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |displayName|string|true||| |name|string|true| Pattern:[a-zA-Z]\\w*|| |description|string|false||| |ownerOrganizationId|string|false||| |analyticsDbConfiguration|object|false||| |analyticsDbConfiguration.name|string|false||| |forceUpdate|boolean|false||| |customAttributes|array|false||| |customAttributes[index]|array|false||| |customAttributes[index].displayName|string|true(*)||| |customAttributes[index].phi|boolean|false||| |customAttributes[index].referenceConfiguration|object|false||| |customAttributes[index].referenceConfiguration.uniquely|boolean|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |customAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |customAttributes[index].referenceConfiguration.entityType|string|true(*)||| |customAttributes[index].linkConfiguration|object|false||| |customAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |customAttributes[index].linkConfiguration.templateId|string|true(*)||| |customAttributes[index].linkConfiguration.attributeId|string|true(*)||| |customAttributes[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].type|string|true(*)| Values:LABEL,PARAGRAPH,INTEGER,DECIMAL,BOOLEAN,SINGLE_SELECT,MULTI_SELECT,ADDRESS,NAME,PHONE,EMAIL,DATE_TIME,DATE,REFERENCE,TIMEZONE,LOCALE,FILE,IMAGE,LINK,WAVEFORM|| |customAttributes[index].validation|object|false||| |customAttributes[index].validation.mandatory|boolean|true(*)||| |customAttributes[index].validation.defaultValue|object|false||| |customAttributes[index].validation.min|number|false||| |customAttributes[index].validation.max|number|false||| |customAttributes[index].validation.regex|string|false||| |customAttributes[index].numericMetaData|object|false||| |customAttributes[index].numericMetaData.units|string|false||| |customAttributes[index].numericMetaData.upperRange|number|false||| |customAttributes[index].numericMetaData.lowerRange|number|false||| |customAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |customAttributes[index].analyticsDbConfiguration|object|false||| |customAttributes[index].analyticsDbConfiguration.name|string|false||| |customAttributes[index].id|string|false||| |customAttributes[index].selectableValues|array|false||| |customAttributes[index].selectableValues[index]|array|false||| |customAttributes[index].selectableValues[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].selectableValues[index].displayName|string|true(*)||| |customAttributes[index].selectableValues[index].id|string|false||| |customAttributes[index].category|string|true(*)||| |builtInAttributes|array|false||| |builtInAttributes[index]|array|false||| |builtInAttributes[index].id|string|true(*)||| |builtInAttributes[index].displayName|string|true(*)||| |builtInAttributes[index].phi|boolean|false||| |builtInAttributes[index].referenceConfiguration|object|false||| |builtInAttributes[index].referenceConfiguration.uniquely|boolean|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |builtInAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |builtInAttributes[index].referenceConfiguration.entityType|string|true(*)||| |builtInAttributes[index].linkConfiguration|object|false||| |builtInAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |builtInAttributes[index].linkConfiguration.templateId|string|true(*)||| |builtInAttributes[index].linkConfiguration.attributeId|string|true(*)||| |builtInAttributes[index].validation|object|false||| |builtInAttributes[index].validation.mandatory|boolean|true(*)||| |builtInAttributes[index].validation.defaultValue|object|false||| |builtInAttributes[index].validation.min|number|false||| |builtInAttributes[index].validation.max|number|false||| |builtInAttributes[index].validation.regex|string|false||| |builtInAttributes[index].numericMetaData|object|false||| |builtInAttributes[index].numericMetaData.units|string|false||| |builtInAttributes[index].numericMetaData.upperRange|number|false||| |builtInAttributes[index].numericMetaData.lowerRange|number|false||| |builtInAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |templateAttributes|array|false||| |templateAttributes[index]|array|false||| |templateAttributes[index].id|string|true(*)||| |templateAttributes[index].displayName|string|true(*)||| |templateAttributes[index].phi|boolean|false||| |templateAttributes[index].referenceConfiguration|object|false||| |templateAttributes[index].referenceConfiguration.uniquely|boolean|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |templateAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |templateAttributes[index].referenceConfiguration.entityType|string|true(*)||| |templateAttributes[index].linkConfiguration|object|false||| |templateAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |templateAttributes[index].linkConfiguration.templateId|string|true(*)||| |templateAttributes[index].linkConfiguration.attributeId|string|true(*)||| |templateAttributes[index].value|object|false||| |templateAttributes[index].organizationSelectionConfiguration|object|false||| |templateAttributes[index].organizationSelectionConfiguration.selected|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index]|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index].id|string|true(*)||| |templateAttributes[index].organizationSelectionConfiguration.all|boolean|false||| |parentTemplateId|string|false||| Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null|| Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |force|boolean|false|Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode. If 'force' is not provided fallback is the 'forceUpdate' value inside 'templateRequest'|true|   This API requires **SETTINGS_UPDATE_TEMPLATE** permission(s).  

        :param update_template_request: (required)
        :type update_template_request: UpdateTemplateRequest
        :param template_id: (required)
        :type template_id: UUID
        :param force: Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode. If 'force' is not provided fallback is the 'forceUpdate' value inside 'templateRequest'
        :type force: 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._update_template_serialize(
            update_template_request=update_template_request,
            template_id=template_id,
            force=force,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "GetTemplateResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
            '409': "ErrorResponse",
        }
        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_template_without_preload_content(
        self,
        update_template_request: UpdateTemplateRequest,
        template_id: UUID,
        force: Annotated[Optional[StrictBool], Field(description="Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode. If 'force' is not provided fallback is the 'forceUpdate' value inside 'templateRequest'")] = 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:
        """Update Template

        Update Template  Performs full update, the values will be replaced with values that are specified in the request  Important notice: This is a full update API (PUT), all existing attributes must be specified in the request body. Attributes that are not specified will be deleted from the updated record (receive a NULL value).  (*)This parameter is mandatory only if its optional parent attribute is defined. Click <a href=\"https://docs.biot-med.com/docs/biot-rest-api#api-optional-parameters\" target=\"_blank\">here</a> for more information.  Request Body Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |displayName|string|true||| |name|string|true| Pattern:[a-zA-Z]\\w*|| |description|string|false||| |ownerOrganizationId|string|false||| |analyticsDbConfiguration|object|false||| |analyticsDbConfiguration.name|string|false||| |forceUpdate|boolean|false||| |customAttributes|array|false||| |customAttributes[index]|array|false||| |customAttributes[index].displayName|string|true(*)||| |customAttributes[index].phi|boolean|false||| |customAttributes[index].referenceConfiguration|object|false||| |customAttributes[index].referenceConfiguration.uniquely|boolean|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |customAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |customAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |customAttributes[index].referenceConfiguration.entityType|string|true(*)||| |customAttributes[index].linkConfiguration|object|false||| |customAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |customAttributes[index].linkConfiguration.templateId|string|true(*)||| |customAttributes[index].linkConfiguration.attributeId|string|true(*)||| |customAttributes[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].type|string|true(*)| Values:LABEL,PARAGRAPH,INTEGER,DECIMAL,BOOLEAN,SINGLE_SELECT,MULTI_SELECT,ADDRESS,NAME,PHONE,EMAIL,DATE_TIME,DATE,REFERENCE,TIMEZONE,LOCALE,FILE,IMAGE,LINK,WAVEFORM|| |customAttributes[index].validation|object|false||| |customAttributes[index].validation.mandatory|boolean|true(*)||| |customAttributes[index].validation.defaultValue|object|false||| |customAttributes[index].validation.min|number|false||| |customAttributes[index].validation.max|number|false||| |customAttributes[index].validation.regex|string|false||| |customAttributes[index].numericMetaData|object|false||| |customAttributes[index].numericMetaData.units|string|false||| |customAttributes[index].numericMetaData.upperRange|number|false||| |customAttributes[index].numericMetaData.lowerRange|number|false||| |customAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |customAttributes[index].analyticsDbConfiguration|object|false||| |customAttributes[index].analyticsDbConfiguration.name|string|false||| |customAttributes[index].id|string|false||| |customAttributes[index].selectableValues|array|false||| |customAttributes[index].selectableValues[index]|array|false||| |customAttributes[index].selectableValues[index].name|string|true(*)| Pattern:[a-zA-Z]\\w*|| |customAttributes[index].selectableValues[index].displayName|string|true(*)||| |customAttributes[index].selectableValues[index].id|string|false||| |customAttributes[index].category|string|true(*)||| |builtInAttributes|array|false||| |builtInAttributes[index]|array|false||| |builtInAttributes[index].id|string|true(*)||| |builtInAttributes[index].displayName|string|true(*)||| |builtInAttributes[index].phi|boolean|false||| |builtInAttributes[index].referenceConfiguration|object|false||| |builtInAttributes[index].referenceConfiguration.uniquely|boolean|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |builtInAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |builtInAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |builtInAttributes[index].referenceConfiguration.entityType|string|true(*)||| |builtInAttributes[index].linkConfiguration|object|false||| |builtInAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |builtInAttributes[index].linkConfiguration.templateId|string|true(*)||| |builtInAttributes[index].linkConfiguration.attributeId|string|true(*)||| |builtInAttributes[index].validation|object|false||| |builtInAttributes[index].validation.mandatory|boolean|true(*)||| |builtInAttributes[index].validation.defaultValue|object|false||| |builtInAttributes[index].validation.min|number|false||| |builtInAttributes[index].validation.max|number|false||| |builtInAttributes[index].validation.regex|string|false||| |builtInAttributes[index].numericMetaData|object|false||| |builtInAttributes[index].numericMetaData.units|string|false||| |builtInAttributes[index].numericMetaData.upperRange|number|false||| |builtInAttributes[index].numericMetaData.lowerRange|number|false||| |builtInAttributes[index].numericMetaData.subType|string|false| Values:INTEGER,DECIMAL|| |templateAttributes|array|false||| |templateAttributes[index]|array|false||| |templateAttributes[index].id|string|true(*)||| |templateAttributes[index].displayName|string|true(*)||| |templateAttributes[index].phi|boolean|false||| |templateAttributes[index].referenceConfiguration|object|false||| |templateAttributes[index].referenceConfiguration.uniquely|boolean|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeName|string|false||| |templateAttributes[index].referenceConfiguration.referencedSideAttributeDisplayName|string|false||| |templateAttributes[index].referenceConfiguration.validTemplatesToReference|array|false||| |templateAttributes[index].referenceConfiguration.entityType|string|true(*)||| |templateAttributes[index].linkConfiguration|object|false||| |templateAttributes[index].linkConfiguration.entityTypeName|string|true(*)||| |templateAttributes[index].linkConfiguration.templateId|string|true(*)||| |templateAttributes[index].linkConfiguration.attributeId|string|true(*)||| |templateAttributes[index].value|object|false||| |templateAttributes[index].organizationSelectionConfiguration|object|false||| |templateAttributes[index].organizationSelectionConfiguration.selected|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index]|array|false||| |templateAttributes[index].organizationSelectionConfiguration.selected[index].id|string|true(*)||| |templateAttributes[index].organizationSelectionConfiguration.all|boolean|false||| |parentTemplateId|string|false||| Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |templateId|string|true|null|| Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |force|boolean|false|Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode. If 'force' is not provided fallback is the 'forceUpdate' value inside 'templateRequest'|true|   This API requires **SETTINGS_UPDATE_TEMPLATE** permission(s).  

        :param update_template_request: (required)
        :type update_template_request: UpdateTemplateRequest
        :param template_id: (required)
        :type template_id: UUID
        :param force: Sometimes modifying the system's templates can cause side effects to other components. The 'force' flag indicates whether or not to force the template changes even if those side effects were to occur. For example: changing templates will cause Analytics DB to exit syncing data mode. If 'force' is not provided fallback is the 'forceUpdate' value inside 'templateRequest'
        :type force: 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._update_template_serialize(
            update_template_request=update_template_request,
            template_id=template_id,
            force=force,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "GetTemplateResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
            '409': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _update_template_serialize(
        self,
        update_template_request,
        template_id,
        force,
        _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 template_id is not None:
            _path_params['templateId'] = template_id
        # process the query parameters
        if force is not None:
            
            _query_params.append(('force', force))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if update_template_request is not None:
            _body_params = update_template_request


        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/v1/templates/{templateId}',
            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
        )


