# coding: utf-8

"""
    Slack Web API

    One way to interact with the Slack platform is its HTTP RPC-based Web API, a collection of methods requiring OAuth 2.0-based user, bot, or workspace tokens blessed with related OAuth scopes.

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

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

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

from pydantic import Field, StrictBool, StrictStr
from typing import Optional
from typing_extensions import Annotated
from slack_beta_ti.models.usergroups_create_schema import UsergroupsCreateSchema
from slack_beta_ti.models.usergroups_disable_schema import UsergroupsDisableSchema
from slack_beta_ti.models.usergroups_enable_schema import UsergroupsEnableSchema
from slack_beta_ti.models.usergroups_list_schema import UsergroupsListSchema
from slack_beta_ti.models.usergroups_update_schema import UsergroupsUpdateSchema
from slack_beta_ti.models.usergroups_users_list_schema import UsergroupsUsersListSchema
from slack_beta_ti.models.usergroups_users_update_schema import UsergroupsUsersUpdateSchema

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


class UsergroupsApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    def usergroups_create(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        name: Annotated[StrictStr, Field(description="A name for the User Group. Must be unique among User Groups.")],
        channels: Annotated[Optional[StrictStr], Field(description="A comma separated string of encoded channel IDs for which the User Group uses as a default.")] = None,
        description: Annotated[Optional[StrictStr], Field(description="A short description of the User Group.")] = None,
        handle: Annotated[Optional[StrictStr], Field(description="A mention handle. Must be unique among channels, users and User Groups.")] = None,
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in each User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> UsergroupsCreateSchema:
        """usergroups_create

        Create a User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param name: A name for the User Group. Must be unique among User Groups. (required)
        :type name: str
        :param channels: A comma separated string of encoded channel IDs for which the User Group uses as a default.
        :type channels: str
        :param description: A short description of the User Group.
        :type description: str
        :param handle: A mention handle. Must be unique among channels, users and User Groups.
        :type handle: str
        :param include_count: Include the number of users in each User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_create_serialize(
            token=token,
            name=name,
            channels=channels,
            description=description,
            handle=handle,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsCreateSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def usergroups_create_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        name: Annotated[StrictStr, Field(description="A name for the User Group. Must be unique among User Groups.")],
        channels: Annotated[Optional[StrictStr], Field(description="A comma separated string of encoded channel IDs for which the User Group uses as a default.")] = None,
        description: Annotated[Optional[StrictStr], Field(description="A short description of the User Group.")] = None,
        handle: Annotated[Optional[StrictStr], Field(description="A mention handle. Must be unique among channels, users and User Groups.")] = None,
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in each User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> ApiResponse[UsergroupsCreateSchema]:
        """usergroups_create

        Create a User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param name: A name for the User Group. Must be unique among User Groups. (required)
        :type name: str
        :param channels: A comma separated string of encoded channel IDs for which the User Group uses as a default.
        :type channels: str
        :param description: A short description of the User Group.
        :type description: str
        :param handle: A mention handle. Must be unique among channels, users and User Groups.
        :type handle: str
        :param include_count: Include the number of users in each User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_create_serialize(
            token=token,
            name=name,
            channels=channels,
            description=description,
            handle=handle,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsCreateSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def usergroups_create_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        name: Annotated[StrictStr, Field(description="A name for the User Group. Must be unique among User Groups.")],
        channels: Annotated[Optional[StrictStr], Field(description="A comma separated string of encoded channel IDs for which the User Group uses as a default.")] = None,
        description: Annotated[Optional[StrictStr], Field(description="A short description of the User Group.")] = None,
        handle: Annotated[Optional[StrictStr], Field(description="A mention handle. Must be unique among channels, users and User Groups.")] = None,
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in each User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """usergroups_create

        Create a User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param name: A name for the User Group. Must be unique among User Groups. (required)
        :type name: str
        :param channels: A comma separated string of encoded channel IDs for which the User Group uses as a default.
        :type channels: str
        :param description: A short description of the User Group.
        :type description: str
        :param handle: A mention handle. Must be unique among channels, users and User Groups.
        :type handle: str
        :param include_count: Include the number of users in each User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_create_serialize(
            token=token,
            name=name,
            channels=channels,
            description=description,
            handle=handle,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _usergroups_create_serialize(
        self,
        token,
        name,
        channels,
        description,
        handle,
        include_count,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if token is not None:
            _header_params['token'] = token
        # process the form parameters
        if channels is not None:
            _form_params.append(('channels', channels))
        if description is not None:
            _form_params.append(('description', description))
        if handle is not None:
            _form_params.append(('handle', handle))
        if include_count is not None:
            _form_params.append(('include_count', include_count))
        if name is not None:
            _form_params.append(('name', name))
        # process the body parameter


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

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

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/usergroups.create',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            host__=host__,
            request_auth__=request_auth__
        )




    @validate_call
    def usergroups_disable(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to disable.")],
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> UsergroupsDisableSchema:
        """usergroups_disable

        Disable an existing User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to disable. (required)
        :type usergroup: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_disable_serialize(
            token=token,
            usergroup=usergroup,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsDisableSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def usergroups_disable_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to disable.")],
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> ApiResponse[UsergroupsDisableSchema]:
        """usergroups_disable

        Disable an existing User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to disable. (required)
        :type usergroup: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_disable_serialize(
            token=token,
            usergroup=usergroup,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsDisableSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def usergroups_disable_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to disable.")],
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """usergroups_disable

        Disable an existing User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to disable. (required)
        :type usergroup: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_disable_serialize(
            token=token,
            usergroup=usergroup,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _usergroups_disable_serialize(
        self,
        token,
        usergroup,
        include_count,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if token is not None:
            _header_params['token'] = token
        # process the form parameters
        if include_count is not None:
            _form_params.append(('include_count', include_count))
        if usergroup is not None:
            _form_params.append(('usergroup', usergroup))
        # process the body parameter


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

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

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/usergroups.disable',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            host__=host__,
            request_auth__=request_auth__
        )




    @validate_call
    def usergroups_enable(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to enable.")],
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> UsergroupsEnableSchema:
        """usergroups_enable

        Enable a User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to enable. (required)
        :type usergroup: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_enable_serialize(
            token=token,
            usergroup=usergroup,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsEnableSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def usergroups_enable_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to enable.")],
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> ApiResponse[UsergroupsEnableSchema]:
        """usergroups_enable

        Enable a User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to enable. (required)
        :type usergroup: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_enable_serialize(
            token=token,
            usergroup=usergroup,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsEnableSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def usergroups_enable_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to enable.")],
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """usergroups_enable

        Enable a User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to enable. (required)
        :type usergroup: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_enable_serialize(
            token=token,
            usergroup=usergroup,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _usergroups_enable_serialize(
        self,
        token,
        usergroup,
        include_count,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if token is not None:
            _header_params['token'] = token
        # process the form parameters
        if include_count is not None:
            _form_params.append(('include_count', include_count))
        if usergroup is not None:
            _form_params.append(('usergroup', usergroup))
        # process the body parameter


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

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

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/usergroups.enable',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            host__=host__,
            request_auth__=request_auth__
        )




    @validate_call
    def usergroups_list(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:read`")],
        include_users: Annotated[Optional[StrictBool], Field(description="Include the list of users for each User Group.")] = None,
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in each User Group.")] = None,
        include_disabled: Annotated[Optional[StrictBool], Field(description="Include disabled User Groups.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> UsergroupsListSchema:
        """usergroups_list

        List all User Groups for a team

        :param token: Authentication token. Requires scope: `usergroups:read` (required)
        :type token: str
        :param include_users: Include the list of users for each User Group.
        :type include_users: bool
        :param include_count: Include the number of users in each User Group.
        :type include_count: bool
        :param include_disabled: Include disabled User Groups.
        :type include_disabled: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_list_serialize(
            token=token,
            include_users=include_users,
            include_count=include_count,
            include_disabled=include_disabled,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsListSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def usergroups_list_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:read`")],
        include_users: Annotated[Optional[StrictBool], Field(description="Include the list of users for each User Group.")] = None,
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in each User Group.")] = None,
        include_disabled: Annotated[Optional[StrictBool], Field(description="Include disabled User Groups.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> ApiResponse[UsergroupsListSchema]:
        """usergroups_list

        List all User Groups for a team

        :param token: Authentication token. Requires scope: `usergroups:read` (required)
        :type token: str
        :param include_users: Include the list of users for each User Group.
        :type include_users: bool
        :param include_count: Include the number of users in each User Group.
        :type include_count: bool
        :param include_disabled: Include disabled User Groups.
        :type include_disabled: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_list_serialize(
            token=token,
            include_users=include_users,
            include_count=include_count,
            include_disabled=include_disabled,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsListSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def usergroups_list_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:read`")],
        include_users: Annotated[Optional[StrictBool], Field(description="Include the list of users for each User Group.")] = None,
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in each User Group.")] = None,
        include_disabled: Annotated[Optional[StrictBool], Field(description="Include disabled User Groups.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """usergroups_list

        List all User Groups for a team

        :param token: Authentication token. Requires scope: `usergroups:read` (required)
        :type token: str
        :param include_users: Include the list of users for each User Group.
        :type include_users: bool
        :param include_count: Include the number of users in each User Group.
        :type include_count: bool
        :param include_disabled: Include disabled User Groups.
        :type include_disabled: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_list_serialize(
            token=token,
            include_users=include_users,
            include_count=include_count,
            include_disabled=include_disabled,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _usergroups_list_serialize(
        self,
        token,
        include_users,
        include_count,
        include_disabled,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _collection_formats: Dict[str, str] = {
        }

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

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


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


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/usergroups.list',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            host__=host__,
            request_auth__=request_auth__
        )




    @validate_call
    def usergroups_update(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to update.")],
        handle: Annotated[Optional[StrictStr], Field(description="A mention handle. Must be unique among channels, users and User Groups.")] = None,
        description: Annotated[Optional[StrictStr], Field(description="A short description of the User Group.")] = None,
        channels: Annotated[Optional[StrictStr], Field(description="A comma separated string of encoded channel IDs for which the User Group uses as a default.")] = None,
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        name: Annotated[Optional[StrictStr], Field(description="A name for the User Group. Must be unique among User Groups.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> UsergroupsUpdateSchema:
        """usergroups_update

        Update an existing User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to update. (required)
        :type usergroup: str
        :param handle: A mention handle. Must be unique among channels, users and User Groups.
        :type handle: str
        :param description: A short description of the User Group.
        :type description: str
        :param channels: A comma separated string of encoded channel IDs for which the User Group uses as a default.
        :type channels: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :param name: A name for the User Group. Must be unique among User Groups.
        :type name: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_update_serialize(
            token=token,
            usergroup=usergroup,
            handle=handle,
            description=description,
            channels=channels,
            include_count=include_count,
            name=name,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsUpdateSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def usergroups_update_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to update.")],
        handle: Annotated[Optional[StrictStr], Field(description="A mention handle. Must be unique among channels, users and User Groups.")] = None,
        description: Annotated[Optional[StrictStr], Field(description="A short description of the User Group.")] = None,
        channels: Annotated[Optional[StrictStr], Field(description="A comma separated string of encoded channel IDs for which the User Group uses as a default.")] = None,
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        name: Annotated[Optional[StrictStr], Field(description="A name for the User Group. Must be unique among User Groups.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> ApiResponse[UsergroupsUpdateSchema]:
        """usergroups_update

        Update an existing User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to update. (required)
        :type usergroup: str
        :param handle: A mention handle. Must be unique among channels, users and User Groups.
        :type handle: str
        :param description: A short description of the User Group.
        :type description: str
        :param channels: A comma separated string of encoded channel IDs for which the User Group uses as a default.
        :type channels: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :param name: A name for the User Group. Must be unique among User Groups.
        :type name: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_update_serialize(
            token=token,
            usergroup=usergroup,
            handle=handle,
            description=description,
            channels=channels,
            include_count=include_count,
            name=name,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsUpdateSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def usergroups_update_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to update.")],
        handle: Annotated[Optional[StrictStr], Field(description="A mention handle. Must be unique among channels, users and User Groups.")] = None,
        description: Annotated[Optional[StrictStr], Field(description="A short description of the User Group.")] = None,
        channels: Annotated[Optional[StrictStr], Field(description="A comma separated string of encoded channel IDs for which the User Group uses as a default.")] = None,
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        name: Annotated[Optional[StrictStr], Field(description="A name for the User Group. Must be unique among User Groups.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """usergroups_update

        Update an existing User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to update. (required)
        :type usergroup: str
        :param handle: A mention handle. Must be unique among channels, users and User Groups.
        :type handle: str
        :param description: A short description of the User Group.
        :type description: str
        :param channels: A comma separated string of encoded channel IDs for which the User Group uses as a default.
        :type channels: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :param name: A name for the User Group. Must be unique among User Groups.
        :type name: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_update_serialize(
            token=token,
            usergroup=usergroup,
            handle=handle,
            description=description,
            channels=channels,
            include_count=include_count,
            name=name,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _usergroups_update_serialize(
        self,
        token,
        usergroup,
        handle,
        description,
        channels,
        include_count,
        name,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if token is not None:
            _header_params['token'] = token
        # process the form parameters
        if handle is not None:
            _form_params.append(('handle', handle))
        if description is not None:
            _form_params.append(('description', description))
        if channels is not None:
            _form_params.append(('channels', channels))
        if include_count is not None:
            _form_params.append(('include_count', include_count))
        if usergroup is not None:
            _form_params.append(('usergroup', usergroup))
        if name is not None:
            _form_params.append(('name', name))
        # process the body parameter


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

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

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/usergroups.update',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            host__=host__,
            request_auth__=request_auth__
        )




    @validate_call
    def usergroups_users_list(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:read`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to update.")],
        include_disabled: Annotated[Optional[StrictBool], Field(description="Allow results that involve disabled User Groups.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> UsergroupsUsersListSchema:
        """usergroups_users_list

        List all users in a User Group

        :param token: Authentication token. Requires scope: `usergroups:read` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to update. (required)
        :type usergroup: str
        :param include_disabled: Allow results that involve disabled User Groups.
        :type include_disabled: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_users_list_serialize(
            token=token,
            usergroup=usergroup,
            include_disabled=include_disabled,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsUsersListSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def usergroups_users_list_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:read`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to update.")],
        include_disabled: Annotated[Optional[StrictBool], Field(description="Allow results that involve disabled User Groups.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> ApiResponse[UsergroupsUsersListSchema]:
        """usergroups_users_list

        List all users in a User Group

        :param token: Authentication token. Requires scope: `usergroups:read` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to update. (required)
        :type usergroup: str
        :param include_disabled: Allow results that involve disabled User Groups.
        :type include_disabled: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_users_list_serialize(
            token=token,
            usergroup=usergroup,
            include_disabled=include_disabled,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsUsersListSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def usergroups_users_list_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:read`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to update.")],
        include_disabled: Annotated[Optional[StrictBool], Field(description="Allow results that involve disabled User Groups.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """usergroups_users_list

        List all users in a User Group

        :param token: Authentication token. Requires scope: `usergroups:read` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to update. (required)
        :type usergroup: str
        :param include_disabled: Allow results that involve disabled User Groups.
        :type include_disabled: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_users_list_serialize(
            token=token,
            usergroup=usergroup,
            include_disabled=include_disabled,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _usergroups_users_list_serialize(
        self,
        token,
        usergroup,
        include_disabled,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _collection_formats: Dict[str, str] = {
        }

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

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


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


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/usergroups.users.list',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            host__=host__,
            request_auth__=request_auth__
        )




    @validate_call
    def usergroups_users_update(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to update.")],
        users: Annotated[StrictStr, Field(description="A comma separated string of encoded user IDs that represent the entire list of users for the User Group.")],
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> UsergroupsUsersUpdateSchema:
        """usergroups_users_update

        Update the list of users for a User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to update. (required)
        :type usergroup: str
        :param users: A comma separated string of encoded user IDs that represent the entire list of users for the User Group. (required)
        :type users: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_users_update_serialize(
            token=token,
            usergroup=usergroup,
            users=users,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsUsersUpdateSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def usergroups_users_update_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to update.")],
        users: Annotated[StrictStr, Field(description="A comma separated string of encoded user IDs that represent the entire list of users for the User Group.")],
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> ApiResponse[UsergroupsUsersUpdateSchema]:
        """usergroups_users_update

        Update the list of users for a User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to update. (required)
        :type usergroup: str
        :param users: A comma separated string of encoded user IDs that represent the entire list of users for the User Group. (required)
        :type users: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_users_update_serialize(
            token=token,
            usergroup=usergroup,
            users=users,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UsergroupsUsersUpdateSchema",
        }
        response_data = self.api_client.call_api(
            *_param,
            request_timeout__=request_timeout__
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def usergroups_users_update_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `usergroups:write`")],
        usergroup: Annotated[StrictStr, Field(description="The encoded ID of the User Group to update.")],
        users: Annotated[StrictStr, Field(description="A comma separated string of encoded user IDs that represent the entire list of users for the User Group.")],
        include_count: Annotated[Optional[StrictBool], Field(description="Include the number of users in the User Group.")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """usergroups_users_update

        Update the list of users for a User Group

        :param token: Authentication token. Requires scope: `usergroups:write` (required)
        :type token: str
        :param usergroup: The encoded ID of the User Group to update. (required)
        :type usergroup: str
        :param users: A comma separated string of encoded user IDs that represent the entire list of users for the User Group. (required)
        :type users: str
        :param include_count: Include the number of users in the User Group.
        :type include_count: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._usergroups_users_update_serialize(
            token=token,
            usergroup=usergroup,
            users=users,
            include_count=include_count,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _usergroups_users_update_serialize(
        self,
        token,
        usergroup,
        users,
        include_count,
        request_auth__,
        content_type__,
        headers__,
        host__,
    ) -> RequestSerialized:


        _collection_formats: Dict[str, str] = {
        }

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

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if token is not None:
            _header_params['token'] = token
        # process the form parameters
        if include_count is not None:
            _form_params.append(('include_count', include_count))
        if usergroup is not None:
            _form_params.append(('usergroup', usergroup))
        if users is not None:
            _form_params.append(('users', users))
        # process the body parameter


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

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

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/usergroups.users.update',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            host__=host__,
            request_auth__=request_auth__
        )


