# 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_ti.models.default_success_template import DefaultSuccessTemplate

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


class AdminUsergroupsApi:
    """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 admin_usergroups_add_channels(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.usergroups:write`")],
        usergroup_id: Annotated[StrictStr, Field(description="ID of the IDP group to add default channels for.")],
        channel_ids: Annotated[StrictStr, Field(description="Comma separated string of channel IDs.")],
        team_id: Annotated[Optional[StrictStr], Field(description="The workspace to add default channels in.")] = 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,
    ) -> DefaultSuccessTemplate:
        """admin_usergroups_add_channels

        Add one or more default channels to an IDP group.

        :param token: Authentication token. Requires scope: `admin.usergroups:write` (required)
        :type token: str
        :param usergroup_id: ID of the IDP group to add default channels for. (required)
        :type usergroup_id: str
        :param channel_ids: Comma separated string of channel IDs. (required)
        :type channel_ids: str
        :param team_id: The workspace to add default channels in.
        :type team_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_add_channels_serialize(
            token=token,
            usergroup_id=usergroup_id,
            channel_ids=channel_ids,
            team_id=team_id,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 admin_usergroups_add_channels_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.usergroups:write`")],
        usergroup_id: Annotated[StrictStr, Field(description="ID of the IDP group to add default channels for.")],
        channel_ids: Annotated[StrictStr, Field(description="Comma separated string of channel IDs.")],
        team_id: Annotated[Optional[StrictStr], Field(description="The workspace to add default channels in.")] = 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[DefaultSuccessTemplate]:
        """admin_usergroups_add_channels

        Add one or more default channels to an IDP group.

        :param token: Authentication token. Requires scope: `admin.usergroups:write` (required)
        :type token: str
        :param usergroup_id: ID of the IDP group to add default channels for. (required)
        :type usergroup_id: str
        :param channel_ids: Comma separated string of channel IDs. (required)
        :type channel_ids: str
        :param team_id: The workspace to add default channels in.
        :type team_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_add_channels_serialize(
            token=token,
            usergroup_id=usergroup_id,
            channel_ids=channel_ids,
            team_id=team_id,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 admin_usergroups_add_channels_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.usergroups:write`")],
        usergroup_id: Annotated[StrictStr, Field(description="ID of the IDP group to add default channels for.")],
        channel_ids: Annotated[StrictStr, Field(description="Comma separated string of channel IDs.")],
        team_id: Annotated[Optional[StrictStr], Field(description="The workspace to add default channels in.")] = 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:
        """admin_usergroups_add_channels

        Add one or more default channels to an IDP group.

        :param token: Authentication token. Requires scope: `admin.usergroups:write` (required)
        :type token: str
        :param usergroup_id: ID of the IDP group to add default channels for. (required)
        :type usergroup_id: str
        :param channel_ids: Comma separated string of channel IDs. (required)
        :type channel_ids: str
        :param team_id: The workspace to add default channels in.
        :type team_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_add_channels_serialize(
            token=token,
            usergroup_id=usergroup_id,
            channel_ids=channel_ids,
            team_id=team_id,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _admin_usergroups_add_channels_serialize(
        self,
        token,
        usergroup_id,
        channel_ids,
        team_id,
        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 usergroup_id is not None:
            _form_params.append(('usergroup_id', usergroup_id))
        if team_id is not None:
            _form_params.append(('team_id', team_id))
        if channel_ids is not None:
            _form_params.append(('channel_ids', channel_ids))
        # 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='/admin.usergroups.addChannels',
            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 admin_usergroups_add_teams(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.teams:write`")],
        usergroup_id: Annotated[StrictStr, Field(description="An encoded usergroup (IDP Group) ID.")],
        team_ids: Annotated[StrictStr, Field(description="A comma separated list of encoded team (workspace) IDs. Each workspace *MUST* belong to the organization associated with the token.")],
        auto_provision: Annotated[Optional[StrictBool], Field(description="When `true`, this method automatically creates new workspace accounts for the IDP group members.")] = 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,
    ) -> DefaultSuccessTemplate:
        """admin_usergroups_add_teams

        Associate one or more default workspaces with an organization-wide IDP group.

        :param token: Authentication token. Requires scope: `admin.teams:write` (required)
        :type token: str
        :param usergroup_id: An encoded usergroup (IDP Group) ID. (required)
        :type usergroup_id: str
        :param team_ids: A comma separated list of encoded team (workspace) IDs. Each workspace *MUST* belong to the organization associated with the token. (required)
        :type team_ids: str
        :param auto_provision: When `true`, this method automatically creates new workspace accounts for the IDP group members.
        :type auto_provision: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_add_teams_serialize(
            token=token,
            usergroup_id=usergroup_id,
            team_ids=team_ids,
            auto_provision=auto_provision,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 admin_usergroups_add_teams_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.teams:write`")],
        usergroup_id: Annotated[StrictStr, Field(description="An encoded usergroup (IDP Group) ID.")],
        team_ids: Annotated[StrictStr, Field(description="A comma separated list of encoded team (workspace) IDs. Each workspace *MUST* belong to the organization associated with the token.")],
        auto_provision: Annotated[Optional[StrictBool], Field(description="When `true`, this method automatically creates new workspace accounts for the IDP group members.")] = 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[DefaultSuccessTemplate]:
        """admin_usergroups_add_teams

        Associate one or more default workspaces with an organization-wide IDP group.

        :param token: Authentication token. Requires scope: `admin.teams:write` (required)
        :type token: str
        :param usergroup_id: An encoded usergroup (IDP Group) ID. (required)
        :type usergroup_id: str
        :param team_ids: A comma separated list of encoded team (workspace) IDs. Each workspace *MUST* belong to the organization associated with the token. (required)
        :type team_ids: str
        :param auto_provision: When `true`, this method automatically creates new workspace accounts for the IDP group members.
        :type auto_provision: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_add_teams_serialize(
            token=token,
            usergroup_id=usergroup_id,
            team_ids=team_ids,
            auto_provision=auto_provision,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 admin_usergroups_add_teams_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.teams:write`")],
        usergroup_id: Annotated[StrictStr, Field(description="An encoded usergroup (IDP Group) ID.")],
        team_ids: Annotated[StrictStr, Field(description="A comma separated list of encoded team (workspace) IDs. Each workspace *MUST* belong to the organization associated with the token.")],
        auto_provision: Annotated[Optional[StrictBool], Field(description="When `true`, this method automatically creates new workspace accounts for the IDP group members.")] = 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:
        """admin_usergroups_add_teams

        Associate one or more default workspaces with an organization-wide IDP group.

        :param token: Authentication token. Requires scope: `admin.teams:write` (required)
        :type token: str
        :param usergroup_id: An encoded usergroup (IDP Group) ID. (required)
        :type usergroup_id: str
        :param team_ids: A comma separated list of encoded team (workspace) IDs. Each workspace *MUST* belong to the organization associated with the token. (required)
        :type team_ids: str
        :param auto_provision: When `true`, this method automatically creates new workspace accounts for the IDP group members.
        :type auto_provision: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_add_teams_serialize(
            token=token,
            usergroup_id=usergroup_id,
            team_ids=team_ids,
            auto_provision=auto_provision,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _admin_usergroups_add_teams_serialize(
        self,
        token,
        usergroup_id,
        team_ids,
        auto_provision,
        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 usergroup_id is not None:
            _form_params.append(('usergroup_id', usergroup_id))
        if team_ids is not None:
            _form_params.append(('team_ids', team_ids))
        if auto_provision is not None:
            _form_params.append(('auto_provision', auto_provision))
        # 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='/admin.usergroups.addTeams',
            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 admin_usergroups_list_channels(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.usergroups:read`")],
        usergroup_id: Annotated[StrictStr, Field(description="ID of the IDP group to list default channels for.")],
        team_id: Annotated[Optional[StrictStr], Field(description="ID of the the workspace.")] = None,
        include_num_members: Annotated[Optional[StrictBool], Field(description="Flag to include or exclude the count of members per channel.")] = 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,
    ) -> DefaultSuccessTemplate:
        """admin_usergroups_list_channels

        List the channels linked to an org-level IDP group (user group).

        :param token: Authentication token. Requires scope: `admin.usergroups:read` (required)
        :type token: str
        :param usergroup_id: ID of the IDP group to list default channels for. (required)
        :type usergroup_id: str
        :param team_id: ID of the the workspace.
        :type team_id: str
        :param include_num_members: Flag to include or exclude the count of members per channel.
        :type include_num_members: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_list_channels_serialize(
            token=token,
            usergroup_id=usergroup_id,
            team_id=team_id,
            include_num_members=include_num_members,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 admin_usergroups_list_channels_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.usergroups:read`")],
        usergroup_id: Annotated[StrictStr, Field(description="ID of the IDP group to list default channels for.")],
        team_id: Annotated[Optional[StrictStr], Field(description="ID of the the workspace.")] = None,
        include_num_members: Annotated[Optional[StrictBool], Field(description="Flag to include or exclude the count of members per channel.")] = 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[DefaultSuccessTemplate]:
        """admin_usergroups_list_channels

        List the channels linked to an org-level IDP group (user group).

        :param token: Authentication token. Requires scope: `admin.usergroups:read` (required)
        :type token: str
        :param usergroup_id: ID of the IDP group to list default channels for. (required)
        :type usergroup_id: str
        :param team_id: ID of the the workspace.
        :type team_id: str
        :param include_num_members: Flag to include or exclude the count of members per channel.
        :type include_num_members: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_list_channels_serialize(
            token=token,
            usergroup_id=usergroup_id,
            team_id=team_id,
            include_num_members=include_num_members,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 admin_usergroups_list_channels_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.usergroups:read`")],
        usergroup_id: Annotated[StrictStr, Field(description="ID of the IDP group to list default channels for.")],
        team_id: Annotated[Optional[StrictStr], Field(description="ID of the the workspace.")] = None,
        include_num_members: Annotated[Optional[StrictBool], Field(description="Flag to include or exclude the count of members per channel.")] = 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:
        """admin_usergroups_list_channels

        List the channels linked to an org-level IDP group (user group).

        :param token: Authentication token. Requires scope: `admin.usergroups:read` (required)
        :type token: str
        :param usergroup_id: ID of the IDP group to list default channels for. (required)
        :type usergroup_id: str
        :param team_id: ID of the the workspace.
        :type team_id: str
        :param include_num_members: Flag to include or exclude the count of members per channel.
        :type include_num_members: bool
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_list_channels_serialize(
            token=token,
            usergroup_id=usergroup_id,
            team_id=team_id,
            include_num_members=include_num_members,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _admin_usergroups_list_channels_serialize(
        self,
        token,
        usergroup_id,
        team_id,
        include_num_members,
        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 usergroup_id is not None:
            
            _query_params.append(('usergroup_id', usergroup_id))
            
        if team_id is not None:
            
            _query_params.append(('team_id', team_id))
            
        if include_num_members is not None:
            
            _query_params.append(('include_num_members', include_num_members))
            
        # process the header parameters
        if token is not None:
            _header_params['token'] = token
        # 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='/admin.usergroups.listChannels',
            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 admin_usergroups_remove_channels(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.usergroups:write`")],
        usergroup_id: Annotated[StrictStr, Field(description="ID of the IDP Group")],
        channel_ids: Annotated[StrictStr, Field(description="Comma-separated string of channel IDs")],
        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,
    ) -> DefaultSuccessTemplate:
        """admin_usergroups_remove_channels

        Remove one or more default channels from an org-level IDP group (user group).

        :param token: Authentication token. Requires scope: `admin.usergroups:write` (required)
        :type token: str
        :param usergroup_id: ID of the IDP Group (required)
        :type usergroup_id: str
        :param channel_ids: Comma-separated string of channel IDs (required)
        :type channel_ids: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_remove_channels_serialize(
            token=token,
            usergroup_id=usergroup_id,
            channel_ids=channel_ids,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 admin_usergroups_remove_channels_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.usergroups:write`")],
        usergroup_id: Annotated[StrictStr, Field(description="ID of the IDP Group")],
        channel_ids: Annotated[StrictStr, Field(description="Comma-separated string of channel IDs")],
        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[DefaultSuccessTemplate]:
        """admin_usergroups_remove_channels

        Remove one or more default channels from an org-level IDP group (user group).

        :param token: Authentication token. Requires scope: `admin.usergroups:write` (required)
        :type token: str
        :param usergroup_id: ID of the IDP Group (required)
        :type usergroup_id: str
        :param channel_ids: Comma-separated string of channel IDs (required)
        :type channel_ids: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_remove_channels_serialize(
            token=token,
            usergroup_id=usergroup_id,
            channel_ids=channel_ids,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "DefaultSuccessTemplate",
        }
        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 admin_usergroups_remove_channels_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.usergroups:write`")],
        usergroup_id: Annotated[StrictStr, Field(description="ID of the IDP Group")],
        channel_ids: Annotated[StrictStr, Field(description="Comma-separated string of channel IDs")],
        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:
        """admin_usergroups_remove_channels

        Remove one or more default channels from an org-level IDP group (user group).

        :param token: Authentication token. Requires scope: `admin.usergroups:write` (required)
        :type token: str
        :param usergroup_id: ID of the IDP Group (required)
        :type usergroup_id: str
        :param channel_ids: Comma-separated string of channel IDs (required)
        :type channel_ids: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_usergroups_remove_channels_serialize(
            token=token,
            usergroup_id=usergroup_id,
            channel_ids=channel_ids,
            request_auth__=request_auth__,
            content_type__=content_type__,
            headers__=headers__,
            host__=host__
        )

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


    def _admin_usergroups_remove_channels_serialize(
        self,
        token,
        usergroup_id,
        channel_ids,
        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 usergroup_id is not None:
            _form_params.append(('usergroup_id', usergroup_id))
        if channel_ids is not None:
            _form_params.append(('channel_ids', channel_ids))
        # 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='/admin.usergroups.removeChannels',
            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__
        )


