# 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, StrictInt, StrictStr
from typing import Optional
from typing_extensions import Annotated
from slack_beta_ti.models.default_success_template import DefaultSuccessTemplate

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 AdminUsersApi:
    """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_users_assign(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to add to the workspace.")],
        is_restricted: Annotated[Optional[StrictBool], Field(description="True if user should be added to the workspace as a guest.")] = None,
        is_ultra_restricted: Annotated[Optional[StrictBool], Field(description="True if user should be added to the workspace as a single-channel guest.")] = None,
        channel_ids: Annotated[Optional[StrictStr], Field(description="Comma separated values of channel IDs to add user in the new workspace.")] = 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_users_assign

        Add an Enterprise user to a workspace.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to add to the workspace. (required)
        :type user_id: str
        :param is_restricted: True if user should be added to the workspace as a guest.
        :type is_restricted: bool
        :param is_ultra_restricted: True if user should be added to the workspace as a single-channel guest.
        :type is_ultra_restricted: bool
        :param channel_ids: Comma separated values of channel IDs to add user in the new workspace.
        :type channel_ids: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_assign_serialize(
            token=token,
            team_id=team_id,
            user_id=user_id,
            is_restricted=is_restricted,
            is_ultra_restricted=is_ultra_restricted,
            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_users_assign_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to add to the workspace.")],
        is_restricted: Annotated[Optional[StrictBool], Field(description="True if user should be added to the workspace as a guest.")] = None,
        is_ultra_restricted: Annotated[Optional[StrictBool], Field(description="True if user should be added to the workspace as a single-channel guest.")] = None,
        channel_ids: Annotated[Optional[StrictStr], Field(description="Comma separated values of channel IDs to add user in the new workspace.")] = 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_users_assign

        Add an Enterprise user to a workspace.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to add to the workspace. (required)
        :type user_id: str
        :param is_restricted: True if user should be added to the workspace as a guest.
        :type is_restricted: bool
        :param is_ultra_restricted: True if user should be added to the workspace as a single-channel guest.
        :type is_ultra_restricted: bool
        :param channel_ids: Comma separated values of channel IDs to add user in the new workspace.
        :type channel_ids: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_assign_serialize(
            token=token,
            team_id=team_id,
            user_id=user_id,
            is_restricted=is_restricted,
            is_ultra_restricted=is_ultra_restricted,
            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_users_assign_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to add to the workspace.")],
        is_restricted: Annotated[Optional[StrictBool], Field(description="True if user should be added to the workspace as a guest.")] = None,
        is_ultra_restricted: Annotated[Optional[StrictBool], Field(description="True if user should be added to the workspace as a single-channel guest.")] = None,
        channel_ids: Annotated[Optional[StrictStr], Field(description="Comma separated values of channel IDs to add user in the new workspace.")] = 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_users_assign

        Add an Enterprise user to a workspace.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to add to the workspace. (required)
        :type user_id: str
        :param is_restricted: True if user should be added to the workspace as a guest.
        :type is_restricted: bool
        :param is_ultra_restricted: True if user should be added to the workspace as a single-channel guest.
        :type is_ultra_restricted: bool
        :param channel_ids: Comma separated values of channel IDs to add user in the new workspace.
        :type channel_ids: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_assign_serialize(
            token=token,
            team_id=team_id,
            user_id=user_id,
            is_restricted=is_restricted,
            is_ultra_restricted=is_ultra_restricted,
            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_users_assign_serialize(
        self,
        token,
        team_id,
        user_id,
        is_restricted,
        is_ultra_restricted,
        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 team_id is not None:
            _form_params.append(('team_id', team_id))
        if user_id is not None:
            _form_params.append(('user_id', user_id))
        if is_restricted is not None:
            _form_params.append(('is_restricted', is_restricted))
        if is_ultra_restricted is not None:
            _form_params.append(('is_ultra_restricted', is_ultra_restricted))
        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.users.assign',
            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_users_invite(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        email: Annotated[StrictStr, Field(description="The email address of the person to invite.")],
        channel_ids: Annotated[StrictStr, Field(description="A comma-separated list of `channel_id`s for this user to join. At least one channel is required.")],
        custom_message: Annotated[Optional[StrictStr], Field(description="An optional message to send to the user in the invite email.")] = None,
        real_name: Annotated[Optional[StrictStr], Field(description="Full name of the user.")] = None,
        resend: Annotated[Optional[StrictBool], Field(description="Allow this invite to be resent in the future if a user has not signed up yet. (default: false)")] = None,
        is_restricted: Annotated[Optional[StrictBool], Field(description="Is this user a multi-channel guest user? (default: false)")] = None,
        is_ultra_restricted: Annotated[Optional[StrictBool], Field(description="Is this user a single channel guest user? (default: false)")] = None,
        guest_expiration_ts: Annotated[Optional[StrictStr], Field(description="Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.")] = 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_users_invite

        Invite a user to a workspace.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param email: The email address of the person to invite. (required)
        :type email: str
        :param channel_ids: A comma-separated list of `channel_id`s for this user to join. At least one channel is required. (required)
        :type channel_ids: str
        :param custom_message: An optional message to send to the user in the invite email.
        :type custom_message: str
        :param real_name: Full name of the user.
        :type real_name: str
        :param resend: Allow this invite to be resent in the future if a user has not signed up yet. (default: false)
        :type resend: bool
        :param is_restricted: Is this user a multi-channel guest user? (default: false)
        :type is_restricted: bool
        :param is_ultra_restricted: Is this user a single channel guest user? (default: false)
        :type is_ultra_restricted: bool
        :param guest_expiration_ts: Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.
        :type guest_expiration_ts: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_invite_serialize(
            token=token,
            team_id=team_id,
            email=email,
            channel_ids=channel_ids,
            custom_message=custom_message,
            real_name=real_name,
            resend=resend,
            is_restricted=is_restricted,
            is_ultra_restricted=is_ultra_restricted,
            guest_expiration_ts=guest_expiration_ts,
            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_users_invite_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        email: Annotated[StrictStr, Field(description="The email address of the person to invite.")],
        channel_ids: Annotated[StrictStr, Field(description="A comma-separated list of `channel_id`s for this user to join. At least one channel is required.")],
        custom_message: Annotated[Optional[StrictStr], Field(description="An optional message to send to the user in the invite email.")] = None,
        real_name: Annotated[Optional[StrictStr], Field(description="Full name of the user.")] = None,
        resend: Annotated[Optional[StrictBool], Field(description="Allow this invite to be resent in the future if a user has not signed up yet. (default: false)")] = None,
        is_restricted: Annotated[Optional[StrictBool], Field(description="Is this user a multi-channel guest user? (default: false)")] = None,
        is_ultra_restricted: Annotated[Optional[StrictBool], Field(description="Is this user a single channel guest user? (default: false)")] = None,
        guest_expiration_ts: Annotated[Optional[StrictStr], Field(description="Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.")] = 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_users_invite

        Invite a user to a workspace.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param email: The email address of the person to invite. (required)
        :type email: str
        :param channel_ids: A comma-separated list of `channel_id`s for this user to join. At least one channel is required. (required)
        :type channel_ids: str
        :param custom_message: An optional message to send to the user in the invite email.
        :type custom_message: str
        :param real_name: Full name of the user.
        :type real_name: str
        :param resend: Allow this invite to be resent in the future if a user has not signed up yet. (default: false)
        :type resend: bool
        :param is_restricted: Is this user a multi-channel guest user? (default: false)
        :type is_restricted: bool
        :param is_ultra_restricted: Is this user a single channel guest user? (default: false)
        :type is_ultra_restricted: bool
        :param guest_expiration_ts: Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.
        :type guest_expiration_ts: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_invite_serialize(
            token=token,
            team_id=team_id,
            email=email,
            channel_ids=channel_ids,
            custom_message=custom_message,
            real_name=real_name,
            resend=resend,
            is_restricted=is_restricted,
            is_ultra_restricted=is_ultra_restricted,
            guest_expiration_ts=guest_expiration_ts,
            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_users_invite_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        email: Annotated[StrictStr, Field(description="The email address of the person to invite.")],
        channel_ids: Annotated[StrictStr, Field(description="A comma-separated list of `channel_id`s for this user to join. At least one channel is required.")],
        custom_message: Annotated[Optional[StrictStr], Field(description="An optional message to send to the user in the invite email.")] = None,
        real_name: Annotated[Optional[StrictStr], Field(description="Full name of the user.")] = None,
        resend: Annotated[Optional[StrictBool], Field(description="Allow this invite to be resent in the future if a user has not signed up yet. (default: false)")] = None,
        is_restricted: Annotated[Optional[StrictBool], Field(description="Is this user a multi-channel guest user? (default: false)")] = None,
        is_ultra_restricted: Annotated[Optional[StrictBool], Field(description="Is this user a single channel guest user? (default: false)")] = None,
        guest_expiration_ts: Annotated[Optional[StrictStr], Field(description="Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.")] = 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_users_invite

        Invite a user to a workspace.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param email: The email address of the person to invite. (required)
        :type email: str
        :param channel_ids: A comma-separated list of `channel_id`s for this user to join. At least one channel is required. (required)
        :type channel_ids: str
        :param custom_message: An optional message to send to the user in the invite email.
        :type custom_message: str
        :param real_name: Full name of the user.
        :type real_name: str
        :param resend: Allow this invite to be resent in the future if a user has not signed up yet. (default: false)
        :type resend: bool
        :param is_restricted: Is this user a multi-channel guest user? (default: false)
        :type is_restricted: bool
        :param is_ultra_restricted: Is this user a single channel guest user? (default: false)
        :type is_ultra_restricted: bool
        :param guest_expiration_ts: Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.
        :type guest_expiration_ts: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_invite_serialize(
            token=token,
            team_id=team_id,
            email=email,
            channel_ids=channel_ids,
            custom_message=custom_message,
            real_name=real_name,
            resend=resend,
            is_restricted=is_restricted,
            is_ultra_restricted=is_ultra_restricted,
            guest_expiration_ts=guest_expiration_ts,
            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_users_invite_serialize(
        self,
        token,
        team_id,
        email,
        channel_ids,
        custom_message,
        real_name,
        resend,
        is_restricted,
        is_ultra_restricted,
        guest_expiration_ts,
        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 team_id is not None:
            _form_params.append(('team_id', team_id))
        if email is not None:
            _form_params.append(('email', email))
        if channel_ids is not None:
            _form_params.append(('channel_ids', channel_ids))
        if custom_message is not None:
            _form_params.append(('custom_message', custom_message))
        if real_name is not None:
            _form_params.append(('real_name', real_name))
        if resend is not None:
            _form_params.append(('resend', resend))
        if is_restricted is not None:
            _form_params.append(('is_restricted', is_restricted))
        if is_ultra_restricted is not None:
            _form_params.append(('is_ultra_restricted', is_ultra_restricted))
        if guest_expiration_ts is not None:
            _form_params.append(('guest_expiration_ts', guest_expiration_ts))
        # 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.users.invite',
            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_users_list(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:read`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        cursor: Annotated[Optional[StrictStr], Field(description="Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Limit for how many users to be retrieved per page")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> DefaultSuccessTemplate:
        """admin_users_list

        List users on a workspace

        :param token: Authentication token. Requires scope: `admin.users:read` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param cursor: Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.
        :type cursor: str
        :param limit: Limit for how many users to be retrieved per page
        :type limit: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_list_serialize(
            token=token,
            team_id=team_id,
            cursor=cursor,
            limit=limit,
            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_users_list_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:read`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        cursor: Annotated[Optional[StrictStr], Field(description="Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Limit for how many users to be retrieved per page")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> ApiResponse[DefaultSuccessTemplate]:
        """admin_users_list

        List users on a workspace

        :param token: Authentication token. Requires scope: `admin.users:read` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param cursor: Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.
        :type cursor: str
        :param limit: Limit for how many users to be retrieved per page
        :type limit: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_list_serialize(
            token=token,
            team_id=team_id,
            cursor=cursor,
            limit=limit,
            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_users_list_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:read`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        cursor: Annotated[Optional[StrictStr], Field(description="Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Limit for how many users to be retrieved per page")] = None,
        request_timeout__: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        request_auth__: Optional[Dict[StrictStr, Any]] = None,
        content_type__: Optional[StrictStr] = None,
        headers__: Optional[Dict[StrictStr, Any]] = None,
        host__: Optional[StrictStr] = None,
    ) -> RESTResponseType:
        """admin_users_list

        List users on a workspace

        :param token: Authentication token. Requires scope: `admin.users:read` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param cursor: Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.
        :type cursor: str
        :param limit: Limit for how many users to be retrieved per page
        :type limit: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_list_serialize(
            token=token,
            team_id=team_id,
            cursor=cursor,
            limit=limit,
            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_users_list_serialize(
        self,
        token,
        team_id,
        cursor,
        limit,
        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 team_id is not None:
            
            _query_params.append(('team_id', team_id))
            
        if cursor is not None:
            
            _query_params.append(('cursor', cursor))
            
        if limit is not None:
            
            _query_params.append(('limit', limit))
            
        # 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.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 admin_users_remove(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to remove.")],
        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_users_remove

        Remove a user from a workspace.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to remove. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_remove_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_remove_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to remove.")],
        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_users_remove

        Remove a user from a workspace.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to remove. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_remove_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_remove_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to remove.")],
        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_users_remove

        Remove a user from a workspace.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to remove. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_remove_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_remove_serialize(
        self,
        token,
        team_id,
        user_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 team_id is not None:
            _form_params.append(('team_id', team_id))
        if user_id is not None:
            _form_params.append(('user_id', user_id))
        # 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.users.remove',
            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_users_set_admin(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to designate as an admin.")],
        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_users_set_admin

        Set an existing guest, regular user, or owner to be an admin user.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to designate as an admin. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_admin_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_set_admin_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to designate as an admin.")],
        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_users_set_admin

        Set an existing guest, regular user, or owner to be an admin user.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to designate as an admin. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_admin_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_set_admin_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to designate as an admin.")],
        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_users_set_admin

        Set an existing guest, regular user, or owner to be an admin user.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to designate as an admin. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_admin_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_set_admin_serialize(
        self,
        token,
        team_id,
        user_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 team_id is not None:
            _form_params.append(('team_id', team_id))
        if user_id is not None:
            _form_params.append(('user_id', user_id))
        # 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.users.setAdmin',
            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_users_set_expiration(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to set an expiration for.")],
        expiration_ts: Annotated[StrictInt, Field(description="Timestamp when guest account should be disabled.")],
        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_users_set_expiration

        Set an expiration for a guest user

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to set an expiration for. (required)
        :type user_id: str
        :param expiration_ts: Timestamp when guest account should be disabled. (required)
        :type expiration_ts: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_expiration_serialize(
            token=token,
            team_id=team_id,
            user_id=user_id,
            expiration_ts=expiration_ts,
            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_users_set_expiration_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to set an expiration for.")],
        expiration_ts: Annotated[StrictInt, Field(description="Timestamp when guest account should be disabled.")],
        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_users_set_expiration

        Set an expiration for a guest user

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to set an expiration for. (required)
        :type user_id: str
        :param expiration_ts: Timestamp when guest account should be disabled. (required)
        :type expiration_ts: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_expiration_serialize(
            token=token,
            team_id=team_id,
            user_id=user_id,
            expiration_ts=expiration_ts,
            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_users_set_expiration_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to set an expiration for.")],
        expiration_ts: Annotated[StrictInt, Field(description="Timestamp when guest account should be disabled.")],
        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_users_set_expiration

        Set an expiration for a guest user

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to set an expiration for. (required)
        :type user_id: str
        :param expiration_ts: Timestamp when guest account should be disabled. (required)
        :type expiration_ts: int
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_expiration_serialize(
            token=token,
            team_id=team_id,
            user_id=user_id,
            expiration_ts=expiration_ts,
            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_users_set_expiration_serialize(
        self,
        token,
        team_id,
        user_id,
        expiration_ts,
        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 team_id is not None:
            _form_params.append(('team_id', team_id))
        if user_id is not None:
            _form_params.append(('user_id', user_id))
        if expiration_ts is not None:
            _form_params.append(('expiration_ts', expiration_ts))
        # 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.users.setExpiration',
            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_users_set_owner(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="Id of the user to promote to owner.")],
        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_users_set_owner

        Set an existing guest, regular user, or admin user to be a workspace owner.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: Id of the user to promote to owner. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_owner_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_set_owner_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="Id of the user to promote to owner.")],
        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_users_set_owner

        Set an existing guest, regular user, or admin user to be a workspace owner.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: Id of the user to promote to owner. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_owner_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_set_owner_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="Id of the user to promote to owner.")],
        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_users_set_owner

        Set an existing guest, regular user, or admin user to be a workspace owner.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: Id of the user to promote to owner. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_owner_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_set_owner_serialize(
        self,
        token,
        team_id,
        user_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 team_id is not None:
            _form_params.append(('team_id', team_id))
        if user_id is not None:
            _form_params.append(('user_id', user_id))
        # 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.users.setOwner',
            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_users_set_regular(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to designate as a regular user.")],
        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_users_set_regular

        Set an existing guest user, admin user, or owner to be a regular user.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to designate as a regular user. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_regular_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_set_regular_with_http_info(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to designate as a regular user.")],
        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_users_set_regular

        Set an existing guest user, admin user, or owner to be a regular user.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to designate as a regular user. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_regular_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_set_regular_without_preload_content(
        self,
        token: Annotated[StrictStr, Field(description="Authentication token. Requires scope: `admin.users:write`")],
        team_id: Annotated[StrictStr, Field(description="The ID (`T1234`) of the workspace.")],
        user_id: Annotated[StrictStr, Field(description="The ID of the user to designate as a regular user.")],
        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_users_set_regular

        Set an existing guest user, admin user, or owner to be a regular user.

        :param token: Authentication token. Requires scope: `admin.users:write` (required)
        :type token: str
        :param team_id: The ID (`T1234`) of the workspace. (required)
        :type team_id: str
        :param user_id: The ID of the user to designate as a regular user. (required)
        :type user_id: str
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._admin_users_set_regular_serialize(
            token=token,
            team_id=team_id,
            user_id=user_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_users_set_regular_serialize(
        self,
        token,
        team_id,
        user_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 team_id is not None:
            _form_params.append(('team_id', team_id))
        if user_id is not None:
            _form_params.append(('user_id', user_id))
        # 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.users.setRegular',
            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__
        )


