# 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_all_groups200_response import GroupAllGroups200Response
from identitylib.lookup_client.models.group_get_cancelled_members200_response import GroupGetCancelledMembers200Response
from identitylib.lookup_client.models.group_get_group200_response import GroupGetGroup200Response
from identitylib.lookup_client.models.group_search_count200_response import GroupSearchCount200Response

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 GroupApi(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 group_all_groups(self, include_cancelled : Annotated[Optional[StrictBool], Field(description="Whether or not to include cancelled groups. By default, only live groups are returned.")] = None, fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> GroupAllGroups200Response:  # noqa: E501
        """Return a list of all groups.  # noqa: E501

        Return a list of all groups.  By default, only a few basic details about each group 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.group_all_groups(include_cancelled, fetch, async_req=True)
        >>> result = thread.get()

        :param include_cancelled: Whether or not to include cancelled groups. By default, only live groups 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: GroupAllGroups200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the group_all_groups_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.group_all_groups_with_http_info(include_cancelled, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def group_all_groups_with_http_info(self, include_cancelled : Annotated[Optional[StrictBool], Field(description="Whether or not to include cancelled groups. By default, only live groups 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 groups.  # noqa: E501

        Return a list of all groups.  By default, only a few basic details about each group 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.group_all_groups_with_http_info(include_cancelled, fetch, async_req=True)
        >>> result = thread.get()

        :param include_cancelled: Whether or not to include cancelled groups. By default, only live groups 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(GroupAllGroups200Response, 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 group_all_groups" % _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': "GroupAllGroups200Response",
        }

        return self.api_client.call_api(
            '/group/all-groups', '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 group_get_cancelled_members(self, groupid : Annotated[StrictStr, Field(..., description="The ID or name of the group.")], 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 group, including cancelled members of groups included by the group, and groups included by those groups, and so on.  # noqa: E501

        Get all the cancelled members of the specified group, including cancelled members of groups included by the group, and groups included by those groups, and so on.  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 group. 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 group 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.group_get_cancelled_members(groupid, fetch, async_req=True)
        >>> result = thread.get()

        :param groupid: The ID or name of the group. (required)
        :type groupid: 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 group_get_cancelled_members_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.group_get_cancelled_members_with_http_info(groupid, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def group_get_cancelled_members_with_http_info(self, groupid : Annotated[StrictStr, Field(..., description="The ID or name of the group.")], 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 group, including cancelled members of groups included by the group, and groups included by those groups, and so on.  # noqa: E501

        Get all the cancelled members of the specified group, including cancelled members of groups included by the group, and groups included by those groups, and so on.  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 group. 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 group 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.group_get_cancelled_members_with_http_info(groupid, fetch, async_req=True)
        >>> result = thread.get()

        :param groupid: The ID or name of the group. (required)
        :type groupid: 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 = [
            'groupid',
            '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 group_get_cancelled_members" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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


        # 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(
            '/group/{groupid}/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 group_get_direct_members(self, groupid : Annotated[StrictStr, Field(..., description="The ID or name of the group.")], 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 the direct members of the specified group, not including members included via groups included by the group.  # noqa: E501

        Get the direct members of the specified group, not including members included via groups included by the group.  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.group_get_direct_members(groupid, fetch, async_req=True)
        >>> result = thread.get()

        :param groupid: The ID or name of the group. (required)
        :type groupid: 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 group_get_direct_members_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.group_get_direct_members_with_http_info(groupid, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def group_get_direct_members_with_http_info(self, groupid : Annotated[StrictStr, Field(..., description="The ID or name of the group.")], 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 the direct members of the specified group, not including members included via groups included by the group.  # noqa: E501

        Get the direct members of the specified group, not including members included via groups included by the group.  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.group_get_direct_members_with_http_info(groupid, fetch, async_req=True)
        >>> result = thread.get()

        :param groupid: The ID or name of the group. (required)
        :type groupid: 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 = [
            'groupid',
            '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 group_get_direct_members" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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


        # 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(
            '/group/{groupid}/direct-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 group_get_group(self, groupid : Annotated[StrictStr, Field(..., description="The ID or name of the group to fetch. This may be either the numeric ID or the short hyphenated group name (for example `\"100656\"` or `\"cs-editors\"`).")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> GroupGetGroup200Response:  # noqa: E501
        """Get the group with the specified ID or name.  # noqa: E501

        Get the group with the specified ID or name.  By default, only a few basic details about the group are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of the group.  NOTE: The group returned may be a cancelled group. 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.group_get_group(groupid, fetch, async_req=True)
        >>> result = thread.get()

        :param groupid: The ID or name of the group to fetch. This may be either the numeric ID or the short hyphenated group name (for example `\"100656\"` or `\"cs-editors\"`). (required)
        :type groupid: 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: GroupGetGroup200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the group_get_group_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.group_get_group_with_http_info(groupid, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def group_get_group_with_http_info(self, groupid : Annotated[StrictStr, Field(..., description="The ID or name of the group to fetch. This may be either the numeric ID or the short hyphenated group name (for example `\"100656\"` or `\"cs-editors\"`).")], 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 group with the specified ID or name.  # noqa: E501

        Get the group with the specified ID or name.  By default, only a few basic details about the group are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references of the group.  NOTE: The group returned may be a cancelled group. 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.group_get_group_with_http_info(groupid, fetch, async_req=True)
        >>> result = thread.get()

        :param groupid: The ID or name of the group to fetch. This may be either the numeric ID or the short hyphenated group name (for example `\"100656\"` or `\"cs-editors\"`). (required)
        :type groupid: 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(GroupGetGroup200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'groupid',
            '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 group_get_group" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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


        # 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': "GroupGetGroup200Response",
        }

        return self.api_client.call_api(
            '/group/{groupid}', '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 group_get_members(self, groupid : Annotated[StrictStr, Field(..., description="The ID or name of the group.")], 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 group, including members of groups included by the group, and groups included by those groups, and so on.  # noqa: E501

        Get all the members of the specified group, including members of groups included by the group, and groups included by those groups, and so on.  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.group_get_members(groupid, fetch, async_req=True)
        >>> result = thread.get()

        :param groupid: The ID or name of the group. (required)
        :type groupid: 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 group_get_members_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.group_get_members_with_http_info(groupid, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def group_get_members_with_http_info(self, groupid : Annotated[StrictStr, Field(..., description="The ID or name of the group.")], 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 group, including members of groups included by the group, and groups included by those groups, and so on.  # noqa: E501

        Get all the members of the specified group, including members of groups included by the group, and groups included by those groups, and so on.  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.group_get_members_with_http_info(groupid, fetch, async_req=True)
        >>> result = thread.get()

        :param groupid: The ID or name of the group. (required)
        :type groupid: 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 = [
            'groupid',
            '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 group_get_members" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

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


        # 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(
            '/group/{groupid}/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 group_list_groups(self, groupids : Annotated[StrictStr, Field(..., description="A comma-separated list of group IDs or group names (may be a mix of both).")], fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> GroupAllGroups200Response:  # noqa: E501
        """Get the groups with the specified IDs or names.  # noqa: E501

        Get the groups with the specified IDs or names.  By default, only a few basic details about each group are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  The results are sorted by groupid.  NOTE: The URL path length is limited to around 8000 characters, which limits the number of groups that this method can fetch. Group IDs are currently 6 characters long, and must be comma separated and URL encoded, which limits this method to around 800 groups by ID, but probably fewer by name, depending on the group name lengths.  NOTE: The groups returned may include cancelled groups. 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.group_list_groups(groupids, fetch, async_req=True)
        >>> result = thread.get()

        :param groupids: A comma-separated list of group IDs or group names (may be a mix of both). (required)
        :type groupids: 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: GroupAllGroups200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the group_list_groups_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.group_list_groups_with_http_info(groupids, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def group_list_groups_with_http_info(self, groupids : Annotated[StrictStr, Field(..., description="A comma-separated list of group IDs or group names (may be a mix of both).")], 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 groups with the specified IDs or names.  # noqa: E501

        Get the groups with the specified IDs or names.  By default, only a few basic details about each group are returned, but the optional `fetch` parameter may be used to fetch additional attributes or references.  The results are sorted by groupid.  NOTE: The URL path length is limited to around 8000 characters, which limits the number of groups that this method can fetch. Group IDs are currently 6 characters long, and must be comma separated and URL encoded, which limits this method to around 800 groups by ID, but probably fewer by name, depending on the group name lengths.  NOTE: The groups returned may include cancelled groups. 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.group_list_groups_with_http_info(groupids, fetch, async_req=True)
        >>> result = thread.get()

        :param groupids: A comma-separated list of group IDs or group names (may be a mix of both). (required)
        :type groupids: 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(GroupAllGroups200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'groupids',
            '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 group_list_groups" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

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

        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': "GroupAllGroups200Response",
        }

        return self.api_client.call_api(
            '/group/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 group_modified_groups(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.")], groupids : Annotated[Optional[StrictStr], Field(description="Only include groups with IDs or names in this list. By default, all modified groups will be included.")] = None, include_cancelled : Annotated[Optional[StrictBool], Field(description="Include cancelled groups. By default, cancelled groups are excluded.")] = None, membership_changes : Annotated[Optional[StrictBool], Field(description="Include groups whose members have changed. By default, changes to group 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) -> GroupAllGroups200Response:  # noqa: E501
        """Find all groups modified between the specified pair of transactions.  # noqa: E501

        Find all groups 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) groups were affected.  By default, only a few basic details about each group 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 group. 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.group_modified_groups(min_tx_id, max_tx_id, groupids, include_cancelled, 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 groupids: Only include groups with IDs or names in this list. By default, all modified groups will be included.
        :type groupids: str
        :param include_cancelled: Include cancelled groups. By default, cancelled groups are excluded.
        :type include_cancelled: bool
        :param membership_changes: Include groups whose members have changed. By default, changes to group 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: GroupAllGroups200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the group_modified_groups_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.group_modified_groups_with_http_info(min_tx_id, max_tx_id, groupids, include_cancelled, membership_changes, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def group_modified_groups_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.")], groupids : Annotated[Optional[StrictStr], Field(description="Only include groups with IDs or names in this list. By default, all modified groups will be included.")] = None, include_cancelled : Annotated[Optional[StrictBool], Field(description="Include cancelled groups. By default, cancelled groups are excluded.")] = None, membership_changes : Annotated[Optional[StrictBool], Field(description="Include groups whose members have changed. By default, changes to group 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 groups modified between the specified pair of transactions.  # noqa: E501

        Find all groups 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) groups were affected.  By default, only a few basic details about each group 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 group. 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.group_modified_groups_with_http_info(min_tx_id, max_tx_id, groupids, include_cancelled, 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 groupids: Only include groups with IDs or names in this list. By default, all modified groups will be included.
        :type groupids: str
        :param include_cancelled: Include cancelled groups. By default, cancelled groups are excluded.
        :type include_cancelled: bool
        :param membership_changes: Include groups whose members have changed. By default, changes to group 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(GroupAllGroups200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'min_tx_id',
            'max_tx_id',
            'groupids',
            'include_cancelled',
            '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 group_modified_groups" % _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('groupids') is not None:  # noqa: E501
            _query_params.append(('groupids', _params['groupids']))

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

        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': "GroupAllGroups200Response",
        }

        return self.api_client.call_api(
            '/group/modified-groups', '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 group_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 groups to be included. Defaults to `false`.")] = 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 `\"groupid\"`, `\"name\"` (the default for non-LQL queries) or `\"title\"`. This is ignored for LQL queries, which always return results in groupid order.")] = None, fetch : Annotated[Optional[StrictStr], Field(description="A comma-separated list of any additional attributes or references to fetch.")] = None, **kwargs) -> GroupAllGroups200Response:  # noqa: E501
        """Search for groups using a free text query string.  # noqa: E501

        Search for groups 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 group 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 `\"group:\"`, it is treated as an [LQL query](/lql), allowing more advanced searches. An LQL query will ignore the `approxMatches` parameter, 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.group_search(query, approx_matches, include_cancelled, 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 groups to be included. Defaults to `false`.
        :type include_cancelled: bool
        :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 `\"groupid\"`, `\"name\"` (the default for non-LQL queries) or `\"title\"`. This is ignored for LQL queries, which always return results in groupid 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: GroupAllGroups200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the group_search_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.group_search_with_http_info(query, approx_matches, include_cancelled, offset, limit, order_by, fetch, **kwargs)  # noqa: E501

    @validate_arguments
    def group_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 groups to be included. Defaults to `false`.")] = 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 `\"groupid\"`, `\"name\"` (the default for non-LQL queries) or `\"title\"`. This is ignored for LQL queries, which always return results in groupid 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 groups using a free text query string.  # noqa: E501

        Search for groups 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 group 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 `\"group:\"`, it is treated as an [LQL query](/lql), allowing more advanced searches. An LQL query will ignore the `approxMatches` parameter, 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.group_search_with_http_info(query, approx_matches, include_cancelled, 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 groups to be included. Defaults to `false`.
        :type include_cancelled: bool
        :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 `\"groupid\"`, `\"name\"` (the default for non-LQL queries) or `\"title\"`. This is ignored for LQL queries, which always return results in groupid 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(GroupAllGroups200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'query',
            'approx_matches',
            'include_cancelled',
            '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 group_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('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': "GroupAllGroups200Response",
        }

        return self.api_client.call_api(
            '/group/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 group_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 groups to be included. Defaults to `false`.")] = None, **kwargs) -> GroupSearchCount200Response:  # noqa: E501
        """Count the number of groups that would be returned by a search using a free text query string.  # noqa: E501

        Count the number of groups that would be returned by a search using a free text query string.  NOTE: If the query string starts with the prefix `\"group:\"`, it is treated as an [LQL query](/lql), allowing more advanced searches. An LQL query will ignore the `approxMatches` parameter, 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.group_search_count(query, approx_matches, include_cancelled, 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 groups to be included. Defaults to `false`.
        :type include_cancelled: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: GroupSearchCount200Response
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the group_search_count_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        return self.group_search_count_with_http_info(query, approx_matches, include_cancelled, **kwargs)  # noqa: E501

    @validate_arguments
    def group_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 groups to be included. Defaults to `false`.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Count the number of groups that would be returned by a search using a free text query string.  # noqa: E501

        Count the number of groups that would be returned by a search using a free text query string.  NOTE: If the query string starts with the prefix `\"group:\"`, it is treated as an [LQL query](/lql), allowing more advanced searches. An LQL query will ignore the `approxMatches` parameter, 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.group_search_count_with_http_info(query, approx_matches, include_cancelled, 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 groups to be included. Defaults to `false`.
        :type include_cancelled: bool
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the authentication
                              in the spec for a single request.
        :type _request_auth: dict, optional
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(GroupSearchCount200Response, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'query',
            'approx_matches',
            'include_cancelled'
        ]
        _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 group_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']))

        # 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(
            '/group/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'))
