# coding: utf-8

"""
    Lookup/Ibis web service API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

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

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


import re  # noqa: F401
import io
import warnings

from pydantic import validate_arguments, ValidationError
from typing_extensions import Annotated

from pydantic import Field, StrictBool, StrictInt, StrictStr

from typing import Optional

from identitylib.lookup_client.models.group_get_cancelled_members200_response import GroupGetCancelledMembers200Response
from identitylib.lookup_client.models.group_search_count200_response import GroupSearchCount200Response
from identitylib.lookup_client.models.institution_all_attribute_schemes200_response import InstitutionAllAttributeSchemes200Response
from identitylib.lookup_client.models.institution_all_insts200_response import InstitutionAllInsts200Response
from identitylib.lookup_client.models.institution_get_attribute200_response import InstitutionGetAttribute200Response
from identitylib.lookup_client.models.institution_get_attributes200_response import InstitutionGetAttributes200Response
from identitylib.lookup_client.models.institution_get_contact_rows200_response import InstitutionGetContactRows200Response
from identitylib.lookup_client.models.institution_get_inst200_response import InstitutionGetInst200Response

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


class InstitutionApi(object):
    """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):
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client

    @validate_arguments
    def institution_all_attribute_schemes(self, **kwargs) -> InstitutionAllAttributeSchemes200Response:  # noqa: E501
        """Return a list of all the institution attribute schemes available.  # noqa: E501

        Return a list of all the institution attribute schemes available. The `schemeid` values of these schemes may be used in the `fetch` parameter of other methods that return institutions.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_all_attribute_schemes(async_req=True)
        >>> result = thread.get()

        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: InstitutionAllAttributeSchemes200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_all_attribute_schemes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_all_attribute_schemes_with_http_info(**kwargs)  # noqa: E501

    @validate_arguments
    def institution_all_attribute_schemes_with_http_info(self, **kwargs) -> ApiResponse:  # noqa: E501
        """Return a list of all the institution attribute schemes available.  # noqa: E501

        Return a list of all the institution attribute schemes available. The `schemeid` values of these schemes may be used in the `fetch` parameter of other methods that return institutions.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_all_attribute_schemes_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(InstitutionAllAttributeSchemes200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

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

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_all_attribute_schemes" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "InstitutionAllAttributeSchemes200Response",
        }

        return self.api_client.call_api(
            '/inst/all-attr-schemes', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_all_insts(self, include_cancelled : Annotated[Optional[StrictBool], Field(description="Whether or not to include cancelled institutions. By default, only live institutions are returned.")] = None, fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> InstitutionAllInsts200Response:  # noqa: E501
        """Return a list of all institutions.  # noqa: E501

        Return a list of all institutions.  By default, only a few basic details about each institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_all_insts(include_cancelled, fetch, async_req=True)
        >>> result = thread.get()

        :param include_cancelled: Whether or not to include cancelled institutions. By default, only live institutions are returned.
        :type include_cancelled: bool
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: InstitutionAllInsts200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_all_insts_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_all_insts_with_http_info(include_cancelled, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_all_insts_with_http_info(self, include_cancelled : Annotated[Optional[StrictBool], Field(description="Whether or not to include cancelled institutions. By default, only live institutions are returned.")] = None, fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Return a list of all institutions.  # noqa: E501

        Return a list of all institutions.  By default, only a few basic details about each institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_all_insts_with_http_info(include_cancelled, fetch, async_req=True)
        >>> result = thread.get()

        :param include_cancelled: Whether or not to include cancelled institutions. By default, only live institutions are returned.
        :type include_cancelled: bool
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(InstitutionAllInsts200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

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

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_all_insts" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

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

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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "InstitutionAllInsts200Response",
        }

        return self.api_client.call_api(
            '/inst/all-insts', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_get_attribute(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], attrid : Annotated[StrictInt, Field(..., description="The ID of the attribute to fetch.")], **kwargs) -> InstitutionGetAttribute200Response:  # noqa: E501
        """Get a specific attribute of an institution.  # noqa: E501

        Get a specific attribute of an institution.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_attribute(instid, attrid, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param attrid: The ID of the attribute to fetch. (required)
        :type attrid: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: InstitutionGetAttribute200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_get_attribute_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_get_attribute_with_http_info(instid, attrid, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_get_attribute_with_http_info(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], attrid : Annotated[StrictInt, Field(..., description="The ID of the attribute to fetch.")], **kwargs) -> ApiResponse:  # noqa: E501
        """Get a specific attribute of an institution.  # noqa: E501

        Get a specific attribute of an institution.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_attribute_with_http_info(instid, attrid, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param attrid: The ID of the attribute to fetch. (required)
        :type attrid: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(InstitutionGetAttribute200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

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

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_get_attribute" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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

        if _params['attrid']:
            _path_params['attrid'] = _params['attrid']


        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "InstitutionGetAttribute200Response",
        }

        return self.api_client.call_api(
            '/inst/{instid}/{attrid}', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_get_attributes(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], attrs : Annotated[StrictStr, Field(..., description="The attribute scheme(s) to fetch. This may include any number of the attributes or pseudo-attributes, but it may not include references or attribute chains (see the documentation for the `fetch` parameter in this class).")], **kwargs) -> InstitutionGetAttributes200Response:  # noqa: E501
        """Get one or more (possibly multi-valued) attributes of an institution.  # noqa: E501

        Get one or more (possibly multi-valued) attributes of an institution. The returned attributes are sorted by attribute scheme precedence and then attribute precedence.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_attributes(instid, attrs, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param attrs: The attribute scheme(s) to fetch. This may include any number of the attributes or pseudo-attributes, but it may not include references or attribute chains (see the documentation for the `fetch` parameter in this class). (required)
        :type attrs: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: InstitutionGetAttributes200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_get_attributes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_get_attributes_with_http_info(instid, attrs, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_get_attributes_with_http_info(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], attrs : Annotated[StrictStr, Field(..., description="The attribute scheme(s) to fetch. This may include any number of the attributes or pseudo-attributes, but it may not include references or attribute chains (see the documentation for the `fetch` parameter in this class).")], **kwargs) -> ApiResponse:  # noqa: E501
        """Get one or more (possibly multi-valued) attributes of an institution.  # noqa: E501

        Get one or more (possibly multi-valued) attributes of an institution. The returned attributes are sorted by attribute scheme precedence and then attribute precedence.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_attributes_with_http_info(instid, attrs, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param attrs: The attribute scheme(s) to fetch. This may include any number of the attributes or pseudo-attributes, but it may not include references or attribute chains (see the documentation for the `fetch` parameter in this class). (required)
        :type attrs: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(InstitutionGetAttributes200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

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

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_get_attributes" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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


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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "InstitutionGetAttributes200Response",
        }

        return self.api_client.call_api(
            '/inst/{instid}/get-attributes', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_get_cancelled_members(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch for each person.")] = None, **kwargs) -> GroupGetCancelledMembers200Response:  # noqa: E501
        """Get all the cancelled members of the specified institution.  # noqa: E501

        Get all the cancelled members of the specified institution.  By default, only a few basic details about each member are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of each person.  NOTE: This method returns only cancelled people. It does not include people who were removed from the institution. Cancelled people are no longer considered to be current staff, students or accredited visitors, and are no longer regarded as belonging to any groups or institutions. The list returned here reflects their institutional memberships just before they were cancelled, and so is out-of-date data that should be used with caution.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_cancelled_members(instid, fetch, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch for each person.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: GroupGetCancelledMembers200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_get_cancelled_members_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_get_cancelled_members_with_http_info(instid, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_get_cancelled_members_with_http_info(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch for each person.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Get all the cancelled members of the specified institution.  # noqa: E501

        Get all the cancelled members of the specified institution.  By default, only a few basic details about each member are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of each person.  NOTE: This method returns only cancelled people. It does not include people who were removed from the institution. Cancelled people are no longer considered to be current staff, students or accredited visitors, and are no longer regarded as belonging to any groups or institutions. The list returned here reflects their institutional memberships just before they were cancelled, and so is out-of-date data that should be used with caution.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_cancelled_members_with_http_info(instid, fetch, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch for each person.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(GroupGetCancelledMembers200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

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

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_get_cancelled_members" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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


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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "GroupGetCancelledMembers200Response",
        }

        return self.api_client.call_api(
            '/inst/{instid}/cancelled-members', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_get_contact_rows(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch for any people referred to by any of the contact rows.")] = None, **kwargs) -> InstitutionGetContactRows200Response:  # noqa: E501
        """Get all the contact rows of the specified institution.  # noqa: E501

        Get all the contact rows of the specified institution.  Any addresses, email addresses, phone numbers and web pages associated with the contact rows are automatically returned, as well as any people referred to by the contact rows.  If any of the contact rows refer to people, then only a few basic details about each person are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of each person.  NOTE: This method will not include cancelled people.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_contact_rows(instid, fetch, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch for any people referred to by any of the contact rows.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: InstitutionGetContactRows200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_get_contact_rows_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_get_contact_rows_with_http_info(instid, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_get_contact_rows_with_http_info(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch for any people referred to by any of the contact rows.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Get all the contact rows of the specified institution.  # noqa: E501

        Get all the contact rows of the specified institution.  Any addresses, email addresses, phone numbers and web pages associated with the contact rows are automatically returned, as well as any people referred to by the contact rows.  If any of the contact rows refer to people, then only a few basic details about each person are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of each person.  NOTE: This method will not include cancelled people.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_contact_rows_with_http_info(instid, fetch, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch for any people referred to by any of the contact rows.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(InstitutionGetContactRows200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

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

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_get_contact_rows" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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


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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "InstitutionGetContactRows200Response",
        }

        return self.api_client.call_api(
            '/inst/{instid}/contact-rows', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_get_inst(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution to fetch.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> InstitutionGetInst200Response:  # noqa: E501
        """Get the institution with the specified ID.  # noqa: E501

        Get the institution with the specified ID.  By default, only a few basic details about the institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of the institution.  NOTE: The institution returned may be a cancelled institution. It is the caller's repsonsibility to check its cancelled flag.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_inst(instid, fetch, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution to fetch. (required)
        :type instid: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: InstitutionGetInst200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_get_inst_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_get_inst_with_http_info(instid, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_get_inst_with_http_info(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution to fetch.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Get the institution with the specified ID.  # noqa: E501

        Get the institution with the specified ID.  By default, only a few basic details about the institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of the institution.  NOTE: The institution returned may be a cancelled institution. It is the caller's repsonsibility to check its cancelled flag.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_inst_with_http_info(instid, fetch, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution to fetch. (required)
        :type instid: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(InstitutionGetInst200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

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

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_get_inst" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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


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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "InstitutionGetInst200Response",
        }

        return self.api_client.call_api(
            '/inst/{instid}', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_get_members(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch for each person.")] = None, **kwargs) -> GroupGetCancelledMembers200Response:  # noqa: E501
        """Get all the members of the specified institution.  # noqa: E501

        Get all the members of the specified institution.  By default, only a few basic details about each member are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of each person.  NOTE: This method will not include cancelled people.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_members(instid, fetch, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch for each person.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: GroupGetCancelledMembers200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_get_members_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_get_members_with_http_info(instid, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_get_members_with_http_info(self, instid : Annotated[StrictStr, Field(..., description="The ID of the institution.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch for each person.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Get all the members of the specified institution.  # noqa: E501

        Get all the members of the specified institution.  By default, only a few basic details about each member are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of each person.  NOTE: This method will not include cancelled people.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_get_members_with_http_info(instid, fetch, async_req=True)
        >>> result = thread.get()

        :param instid: The ID of the institution. (required)
        :type instid: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch for each person.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(GroupGetCancelledMembers200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

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

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_get_members" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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


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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "GroupGetCancelledMembers200Response",
        }

        return self.api_client.call_api(
            '/inst/{instid}/members', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_list_insts(self, instids : Annotated[StrictStr, Field(..., description="A comma-separated list of instids.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> InstitutionAllInsts200Response:  # noqa: E501
        """Get the institutions with the specified IDs.  # noqa: E501

        Get the institutions with the specified IDs.  By default, only a few basic details about each institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  The results are sorted by ID.  NOTE: The URL path length is limited to around 8000 characters, and an instid is up to 8 characters long. Allowing for comma separators and URL encoding, this limits the number of institutions that this method may fetch to around 700.  NOTE: The institutions returned may include cancelled institutions. It is the caller's repsonsibility to check their cancelled flags.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_list_insts(instids, fetch, async_req=True)
        >>> result = thread.get()

        :param instids: A comma-separated list of instids. (required)
        :type instids: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: InstitutionAllInsts200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_list_insts_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_list_insts_with_http_info(instids, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_list_insts_with_http_info(self, instids : Annotated[StrictStr, Field(..., description="A comma-separated list of instids.")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Get the institutions with the specified IDs.  # noqa: E501

        Get the institutions with the specified IDs.  By default, only a few basic details about each institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  The results are sorted by ID.  NOTE: The URL path length is limited to around 8000 characters, and an instid is up to 8 characters long. Allowing for comma separators and URL encoding, this limits the number of institutions that this method may fetch to around 700.  NOTE: The institutions returned may include cancelled institutions. It is the caller's repsonsibility to check their cancelled flags.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_list_insts_with_http_info(instids, fetch, async_req=True)
        >>> result = thread.get()

        :param instids: A comma-separated list of instids. (required)
        :type instids: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(InstitutionAllInsts200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

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

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_list_insts" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

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

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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "InstitutionAllInsts200Response",
        }

        return self.api_client.call_api(
            '/inst/list', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_modified_insts(self, min_tx_id : Annotated[StrictInt, Field(..., description="Include modifications made in transactions after (but not including) this one.")], max_tx_id : Annotated[StrictInt, Field(..., description="Include modifications made in transactions up to and including this one.")], instids : Annotated[Optional[StrictStr], Field(description="Only include institutions with instids in this list. By default, all modified institutions will be included.")] = None, include_cancelled : Annotated[Optional[StrictBool], Field(description="Include cancelled institutions. By default, cancelled institutions are excluded.")] = None, contact_row_changes : Annotated[Optional[StrictBool], Field(description="Include institutions whose contact rows have changed. By default, changes to institution contact rows are not taken into consideration.")] = None, membership_changes : Annotated[Optional[StrictBool], Field(description="Include institutions whose members have changed. By default, changes to institutional memberships are not taken into consideration.")] = None, fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> InstitutionAllInsts200Response:  # noqa: E501
        """Find all institutions modified between the specified pair of transactions.  # noqa: E501

        Find all institutions modified between the specified pair of transactions.  The transaction IDs specified should be the IDs from two different requests for the last (most recent) transaction ID, made at different times, that returned different values, indicating that some Lookup data was modified in the period between the two requests. This method then determines which (if any) institutions were affected.  By default, only a few basic details about each institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  NOTE: All data returned reflects the latest available data about each institution. It is not possible to query for old data, or more detailed information about the specific changes made.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_modified_insts(min_tx_id, max_tx_id, instids, include_cancelled, contact_row_changes, membership_changes, fetch, async_req=True)
        >>> result = thread.get()

        :param min_tx_id: Include modifications made in transactions after (but not including) this one. (required)
        :type min_tx_id: int
        :param max_tx_id: Include modifications made in transactions up to and including this one. (required)
        :type max_tx_id: int
        :param instids: Only include institutions with instids in this list. By default, all modified institutions will be included.
        :type instids: str
        :param include_cancelled: Include cancelled institutions. By default, cancelled institutions are excluded.
        :type include_cancelled: bool
        :param contact_row_changes: Include institutions whose contact rows have changed. By default, changes to institution contact rows are not taken into consideration.
        :type contact_row_changes: bool
        :param membership_changes: Include institutions whose members have changed. By default, changes to institutional memberships are not taken into consideration.
        :type membership_changes: bool
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: InstitutionAllInsts200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_modified_insts_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_modified_insts_with_http_info(min_tx_id, max_tx_id, instids, include_cancelled, contact_row_changes, membership_changes, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_modified_insts_with_http_info(self, min_tx_id : Annotated[StrictInt, Field(..., description="Include modifications made in transactions after (but not including) this one.")], max_tx_id : Annotated[StrictInt, Field(..., description="Include modifications made in transactions up to and including this one.")], instids : Annotated[Optional[StrictStr], Field(description="Only include institutions with instids in this list. By default, all modified institutions will be included.")] = None, include_cancelled : Annotated[Optional[StrictBool], Field(description="Include cancelled institutions. By default, cancelled institutions are excluded.")] = None, contact_row_changes : Annotated[Optional[StrictBool], Field(description="Include institutions whose contact rows have changed. By default, changes to institution contact rows are not taken into consideration.")] = None, membership_changes : Annotated[Optional[StrictBool], Field(description="Include institutions whose members have changed. By default, changes to institutional memberships are not taken into consideration.")] = None, fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Find all institutions modified between the specified pair of transactions.  # noqa: E501

        Find all institutions modified between the specified pair of transactions.  The transaction IDs specified should be the IDs from two different requests for the last (most recent) transaction ID, made at different times, that returned different values, indicating that some Lookup data was modified in the period between the two requests. This method then determines which (if any) institutions were affected.  By default, only a few basic details about each institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  NOTE: All data returned reflects the latest available data about each institution. It is not possible to query for old data, or more detailed information about the specific changes made.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_modified_insts_with_http_info(min_tx_id, max_tx_id, instids, include_cancelled, contact_row_changes, membership_changes, fetch, async_req=True)
        >>> result = thread.get()

        :param min_tx_id: Include modifications made in transactions after (but not including) this one. (required)
        :type min_tx_id: int
        :param max_tx_id: Include modifications made in transactions up to and including this one. (required)
        :type max_tx_id: int
        :param instids: Only include institutions with instids in this list. By default, all modified institutions will be included.
        :type instids: str
        :param include_cancelled: Include cancelled institutions. By default, cancelled institutions are excluded.
        :type include_cancelled: bool
        :param contact_row_changes: Include institutions whose contact rows have changed. By default, changes to institution contact rows are not taken into consideration.
        :type contact_row_changes: bool
        :param membership_changes: Include institutions whose members have changed. By default, changes to institutional memberships are not taken into consideration.
        :type membership_changes: bool
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(InstitutionAllInsts200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'min_tx_id',
            'max_tx_id',
            'instids',
            'include_cancelled',
            'contact_row_changes',
            'membership_changes',
            'fetch'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_modified_insts" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

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

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

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

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

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

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

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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "InstitutionAllInsts200Response",
        }

        return self.api_client.call_api(
            '/inst/modified-insts', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_search(self, query : Annotated[StrictStr, Field(..., description="The search string.")], approx_matches : Annotated[Optional[StrictBool], Field(description="Flag to enable more approximate matching in the search, causing more results to be returned. Defaults to `false`. This is ignored for LQL queries.")] = None, include_cancelled : Annotated[Optional[StrictBool], Field(description="Flag to allow cancelled institutions to be included. Defaults to `false`.")] = None, attributes : Annotated[Optional[StrictStr], Field(description="A comma-separated list of attributes to consider when searching. If this is `null` (the default) then all attribute schemes marked as searchable will be included. This is ignored for LQL queries.")] = None, offset : Annotated[Optional[StrictInt], Field(description="The number of results to skip at the start of the search. Defaults to 0.")] = None, limit : Annotated[Optional[StrictInt], Field(description="The maximum number of results to return. Defaults to 100.")] = None, order_by : Annotated[Optional[StrictStr], Field(description="The order in which to list the results. This may be either `\"instid\"` or `\"name\"` (the default for non-LQL queries). This is ignored for LQL queries, which always return results in instid order.")] = None, fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> InstitutionAllInsts200Response:  # noqa: E501
        """Search for institutions using a free text query string.  # noqa: E501

        Search for institutions using a free text query string. This is the same search function that is used in the Lookup web application.  By default, only a few basic details about each institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  NOTE: If the query string starts with the prefix `\"inst:\"`, it is treated as an [LQL query](/lql), allowing more advanced searches. An LQL query will ignore the `approxMatches` and `attributes` parameters, but it will respect the value of `includeCancelled`. In addition, an LQL query will ignore the `orderBy` parameter, since LQL queries always return results in ID order.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_search(query, approx_matches, include_cancelled, attributes, offset, limit, order_by, fetch, async_req=True)
        >>> result = thread.get()

        :param query: The search string. (required)
        :type query: str
        :param approx_matches: Flag to enable more approximate matching in the search, causing more results to be returned. Defaults to `false`. This is ignored for LQL queries.
        :type approx_matches: bool
        :param include_cancelled: Flag to allow cancelled institutions to be included. Defaults to `false`.
        :type include_cancelled: bool
        :param attributes: A comma-separated list of attributes to consider when searching. If this is `null` (the default) then all attribute schemes marked as searchable will be included. This is ignored for LQL queries.
        :type attributes: str
        :param offset: The number of results to skip at the start of the search. Defaults to 0.
        :type offset: int
        :param limit: The maximum number of results to return. Defaults to 100.
        :type limit: int
        :param order_by: The order in which to list the results. This may be either `\"instid\"` or `\"name\"` (the default for non-LQL queries). This is ignored for LQL queries, which always return results in instid order.
        :type order_by: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: InstitutionAllInsts200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_search_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_search_with_http_info(query, approx_matches, include_cancelled, attributes, offset, limit, order_by, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_search_with_http_info(self, query : Annotated[StrictStr, Field(..., description="The search string.")], approx_matches : Annotated[Optional[StrictBool], Field(description="Flag to enable more approximate matching in the search, causing more results to be returned. Defaults to `false`. This is ignored for LQL queries.")] = None, include_cancelled : Annotated[Optional[StrictBool], Field(description="Flag to allow cancelled institutions to be included. Defaults to `false`.")] = None, attributes : Annotated[Optional[StrictStr], Field(description="A comma-separated list of attributes to consider when searching. If this is `null` (the default) then all attribute schemes marked as searchable will be included. This is ignored for LQL queries.")] = None, offset : Annotated[Optional[StrictInt], Field(description="The number of results to skip at the start of the search. Defaults to 0.")] = None, limit : Annotated[Optional[StrictInt], Field(description="The maximum number of results to return. Defaults to 100.")] = None, order_by : Annotated[Optional[StrictStr], Field(description="The order in which to list the results. This may be either `\"instid\"` or `\"name\"` (the default for non-LQL queries). This is ignored for LQL queries, which always return results in instid order.")] = None, fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Search for institutions using a free text query string.  # noqa: E501

        Search for institutions using a free text query string. This is the same search function that is used in the Lookup web application.  By default, only a few basic details about each institution are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  NOTE: If the query string starts with the prefix `\"inst:\"`, it is treated as an [LQL query](/lql), allowing more advanced searches. An LQL query will ignore the `approxMatches` and `attributes` parameters, but it will respect the value of `includeCancelled`. In addition, an LQL query will ignore the `orderBy` parameter, since LQL queries always return results in ID order.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_search_with_http_info(query, approx_matches, include_cancelled, attributes, offset, limit, order_by, fetch, async_req=True)
        >>> result = thread.get()

        :param query: The search string. (required)
        :type query: str
        :param approx_matches: Flag to enable more approximate matching in the search, causing more results to be returned. Defaults to `false`. This is ignored for LQL queries.
        :type approx_matches: bool
        :param include_cancelled: Flag to allow cancelled institutions to be included. Defaults to `false`.
        :type include_cancelled: bool
        :param attributes: A comma-separated list of attributes to consider when searching. If this is `null` (the default) then all attribute schemes marked as searchable will be included. This is ignored for LQL queries.
        :type attributes: str
        :param offset: The number of results to skip at the start of the search. Defaults to 0.
        :type offset: int
        :param limit: The maximum number of results to return. Defaults to 100.
        :type limit: int
        :param order_by: The order in which to list the results. This may be either `\"instid\"` or `\"name\"` (the default for non-LQL queries). This is ignored for LQL queries, which always return results in instid order.
        :type order_by: str
        :param fetch: A comma-separated list of any additional attributes or references to fetch.
        :type fetch: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(InstitutionAllInsts200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'query',
            'approx_matches',
            'include_cancelled',
            'attributes',
            'offset',
            'limit',
            'order_by',
            'fetch'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_search" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

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

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

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

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

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

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

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

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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "InstitutionAllInsts200Response",
        }

        return self.api_client.call_api(
            '/inst/search', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @validate_arguments
    def institution_search_count(self, query : Annotated[StrictStr, Field(..., description="The search string.")], approx_matches : Annotated[Optional[StrictBool], Field(description="Flag to enable more approximate matching in the search, causing more results to be returned. Defaults to `false`. This is ignored for LQL queries.")] = None, include_cancelled : Annotated[Optional[StrictBool], Field(description="Flag to allow cancelled institutions to be included. Defaults to `false`.")] = None, attributes : Annotated[Optional[StrictStr], Field(description="A comma-separated list of attributes to consider when searching. If this is `null` (the default) then all attribute schemes marked as searchable will be included. This is ignored for LQL queries.")] = None, **kwargs) -> GroupSearchCount200Response:  # noqa: E501
        """Count the number of institutions that would be returned by a search using a free text query string.  # noqa: E501

        Count the number of institutions that would be returned by a search using a free text query string.  NOTE: If the query string starts with the prefix `\"inst:\"`, it is treated as an [LQL query](/lql), allowing more advanced searches. An LQL query will ignore the `approxMatches` and `attributes` parameters, but it will respect the value of `includeCancelled`.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_search_count(query, approx_matches, include_cancelled, attributes, async_req=True)
        >>> result = thread.get()

        :param query: The search string. (required)
        :type query: str
        :param approx_matches: Flag to enable more approximate matching in the search, causing more results to be returned. Defaults to `false`. This is ignored for LQL queries.
        :type approx_matches: bool
        :param include_cancelled: Flag to allow cancelled institutions to be included. Defaults to `false`.
        :type include_cancelled: bool
        :param attributes: A comma-separated list of attributes to consider when searching. If this is `null` (the default) then all attribute schemes marked as searchable will be included. This is ignored for LQL queries.
        :type attributes: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: GroupSearchCount200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the institution_search_count_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.institution_search_count_with_http_info(query, approx_matches, include_cancelled, attributes, **kwargs)  # noqa: E501

    @validate_arguments
    def institution_search_count_with_http_info(self, query : Annotated[StrictStr, Field(..., description="The search string.")], approx_matches : Annotated[Optional[StrictBool], Field(description="Flag to enable more approximate matching in the search, causing more results to be returned. Defaults to `false`. This is ignored for LQL queries.")] = None, include_cancelled : Annotated[Optional[StrictBool], Field(description="Flag to allow cancelled institutions to be included. Defaults to `false`.")] = None, attributes : Annotated[Optional[StrictStr], Field(description="A comma-separated list of attributes to consider when searching. If this is `null` (the default) then all attribute schemes marked as searchable will be included. This is ignored for LQL queries.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Count the number of institutions that would be returned by a search using a free text query string.  # noqa: E501

        Count the number of institutions that would be returned by a search using a free text query string.  NOTE: If the query string starts with the prefix `\"inst:\"`, it is treated as an [LQL query](/lql), allowing more advanced searches. An LQL query will ignore the `approxMatches` and `attributes` parameters, but it will respect the value of `includeCancelled`.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.institution_search_count_with_http_info(query, approx_matches, include_cancelled, attributes, async_req=True)
        >>> result = thread.get()

        :param query: The search string. (required)
        :type query: str
        :param approx_matches: Flag to enable more approximate matching in the search, causing more results to be returned. Defaults to `false`. This is ignored for LQL queries.
        :type approx_matches: bool
        :param include_cancelled: Flag to allow cancelled institutions to be included. Defaults to `false`.
        :type include_cancelled: bool
        :param attributes: A comma-separated list of attributes to consider when searching. If this is `null` (the default) then all attribute schemes marked as searchable will be included. This is ignored for LQL queries.
        :type attributes: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(GroupSearchCount200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'query',
            'approx_matches',
            'include_cancelled',
            'attributes'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method institution_search_count" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

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

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

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

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

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['APIGatewayAuth', 'APIGatewayAuth']  # noqa: E501

        _response_types_map = {
            '200': "GroupSearchCount200Response",
        }

        return self.api_client.call_api(
            '/inst/search-count', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))
