# coding: utf-8

"""
    Asana

    This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml).  # noqa: E501

    OpenAPI spec version: 1.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from asana.api_client import ApiClient


class TeamsApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.

Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""

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

def add_user_for_team(self, body, team_gid, **kwargs):  # noqa: E501
    """Add a user to a team  # noqa: E501

    The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team.  Returns the complete team membership record for the newly added user.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.add_user_for_team(body, team_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param TeamGidAddUserBody body: The user to add to the team. (required)
    :param str team_gid: Globally unique identifier for the team. (required)
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamMembershipResponseData
                If the method is called asynchronously,
                returns the request thread.
    """
    kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True)
    if kwargs.get('async_req'):
        return self.add_user_for_team_with_http_info(body, team_gid, **kwargs)  # noqa: E501
    else:
        (data) = self.add_user_for_team_with_http_info(body, team_gid, **kwargs)  # noqa: E501
        return data

def add_user_for_team_with_http_info(self, body, team_gid, **kwargs):  # noqa: E501
    """Add a user to a team  # noqa: E501

    The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team.  Returns the complete team membership record for the newly added user.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.add_user_for_team_with_http_info(body, team_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param TeamGidAddUserBody body: The user to add to the team. (required)
    :param str team_gid: Globally unique identifier for the team. (required)
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamMembershipResponseData
                If the method is called asynchronously,
                returns the request thread.
    """

    all_params = ['body', 'team_gid', 'opt_fields']  # noqa: E501
    all_params.append('async_req')
    all_params.append('header_params')
    all_params.append('_return_http_data_only')
    all_params.append('_preload_content')
    all_params.append('_request_timeout')

    params = locals()
    for key, val in six.iteritems(params['kwargs']):
        if key not in all_params:
            raise TypeError(
                "Got an unexpected keyword argument '%s'"
                " to method add_user_for_team" % key
            )
        params[key] = val
    del params['kwargs']
    # verify the required parameter 'body' is set
    if ('body' not in params or
            params['body'] is None):
        raise ValueError("Missing the required parameter `body` when calling `add_user_for_team`")  # noqa: E501
    # verify the required parameter 'team_gid' is set
    if ('team_gid' not in params or
            params['team_gid'] is None):
        raise ValueError("Missing the required parameter `team_gid` when calling `add_user_for_team`")  # noqa: E501

    collection_formats = {}

    path_params = {}
    if 'team_gid' in params:
        path_params['team_gid'] = params['team_gid']  # noqa: E501

    query_params = []
    if 'opt_fields' in params:
        query_params.append(('opt_fields', params['opt_fields']))  # noqa: E501
        collection_formats['opt_fields'] = 'csv'  # noqa: E501

    header_params = kwargs.get("header_params", {})

    form_params = []
    local_var_files = {}

    body_params = None
    if 'body' in params:
        body_params = params['body']
    # HTTP header `Accept`
    header_params['Accept'] = self.api_client.select_header_accept(
        ['application/json; charset=UTF-8'])  # noqa: E501

    # HTTP header `Content-Type`
    header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
        ['application/json; charset=UTF-8'])  # noqa: E501

    # Authentication setting
    auth_settings = ['oauth2']  # noqa: E501

    return self.api_client.call_api(
        '/teams/{team_gid}/addUser', 'POST',
        path_params,
        query_params,
        header_params,
        body=body_params,
        post_params=form_params,
        files=local_var_files,
        response_type='TeamMembershipResponseData',  # noqa: E501
        auth_settings=auth_settings,
        async_req=params.get('async_req'),
        _return_http_data_only=params.get('_return_http_data_only'),
        _preload_content=params.get('_preload_content', True),
        _request_timeout=params.get('_request_timeout'),
        collection_formats=collection_formats)

def create_team(self, body, **kwargs):  # noqa: E501
    """Create a team  # noqa: E501

    Creates a team within the current workspace.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.create_team(body, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param TeamsBody body: The team to create. (required)
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseData
                If the method is called asynchronously,
                returns the request thread.
    """
    kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True)
    if kwargs.get('async_req'):
        return self.create_team_with_http_info(body, **kwargs)  # noqa: E501
    else:
        (data) = self.create_team_with_http_info(body, **kwargs)  # noqa: E501
        return data

def create_team_with_http_info(self, body, **kwargs):  # noqa: E501
    """Create a team  # noqa: E501

    Creates a team within the current workspace.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.create_team_with_http_info(body, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param TeamsBody body: The team to create. (required)
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseData
                If the method is called asynchronously,
                returns the request thread.
    """

    all_params = ['body', 'opt_fields']  # noqa: E501
    all_params.append('async_req')
    all_params.append('header_params')
    all_params.append('_return_http_data_only')
    all_params.append('_preload_content')
    all_params.append('_request_timeout')

    params = locals()
    for key, val in six.iteritems(params['kwargs']):
        if key not in all_params:
            raise TypeError(
                "Got an unexpected keyword argument '%s'"
                " to method create_team" % key
            )
        params[key] = val
    del params['kwargs']
    # verify the required parameter 'body' is set
    if ('body' not in params or
            params['body'] is None):
        raise ValueError("Missing the required parameter `body` when calling `create_team`")  # noqa: E501

    collection_formats = {}

    path_params = {}

    query_params = []
    if 'opt_fields' in params:
        query_params.append(('opt_fields', params['opt_fields']))  # noqa: E501
        collection_formats['opt_fields'] = 'csv'  # noqa: E501

    header_params = kwargs.get("header_params", {})

    form_params = []
    local_var_files = {}

    body_params = None
    if 'body' in params:
        body_params = params['body']
    # HTTP header `Accept`
    header_params['Accept'] = self.api_client.select_header_accept(
        ['application/json; charset=UTF-8'])  # noqa: E501

    # HTTP header `Content-Type`
    header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
        ['application/json; charset=UTF-8'])  # noqa: E501

    # Authentication setting
    auth_settings = ['oauth2']  # noqa: E501

    return self.api_client.call_api(
        '/teams', 'POST',
        path_params,
        query_params,
        header_params,
        body=body_params,
        post_params=form_params,
        files=local_var_files,
        response_type='TeamResponseData',  # noqa: E501
        auth_settings=auth_settings,
        async_req=params.get('async_req'),
        _return_http_data_only=params.get('_return_http_data_only'),
        _preload_content=params.get('_preload_content', True),
        _request_timeout=params.get('_request_timeout'),
        collection_formats=collection_formats)

def get_team(self, team_gid, **kwargs):  # noqa: E501
    """Get a team  # noqa: E501

    Returns the full record for a single team.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.get_team(team_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param str team_gid: Globally unique identifier for the team. (required)
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseData
                If the method is called asynchronously,
                returns the request thread.
    """
    kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True)
    if kwargs.get('async_req'):
        return self.get_team_with_http_info(team_gid, **kwargs)  # noqa: E501
    else:
        (data) = self.get_team_with_http_info(team_gid, **kwargs)  # noqa: E501
        return data

def get_team_with_http_info(self, team_gid, **kwargs):  # noqa: E501
    """Get a team  # noqa: E501

    Returns the full record for a single team.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.get_team_with_http_info(team_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param str team_gid: Globally unique identifier for the team. (required)
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseData
                If the method is called asynchronously,
                returns the request thread.
    """

    all_params = ['team_gid', 'opt_fields']  # noqa: E501
    all_params.append('async_req')
    all_params.append('header_params')
    all_params.append('_return_http_data_only')
    all_params.append('_preload_content')
    all_params.append('_request_timeout')

    params = locals()
    for key, val in six.iteritems(params['kwargs']):
        if key not in all_params:
            raise TypeError(
                "Got an unexpected keyword argument '%s'"
                " to method get_team" % key
            )
        params[key] = val
    del params['kwargs']
    # verify the required parameter 'team_gid' is set
    if ('team_gid' not in params or
            params['team_gid'] is None):
        raise ValueError("Missing the required parameter `team_gid` when calling `get_team`")  # noqa: E501

    collection_formats = {}

    path_params = {}
    if 'team_gid' in params:
        path_params['team_gid'] = params['team_gid']  # noqa: E501

    query_params = []
    if 'opt_fields' in params:
        query_params.append(('opt_fields', params['opt_fields']))  # noqa: E501
        collection_formats['opt_fields'] = 'csv'  # noqa: E501

    header_params = kwargs.get("header_params", {})

    form_params = []
    local_var_files = {}

    body_params = None
    # HTTP header `Accept`
    header_params['Accept'] = self.api_client.select_header_accept(
        ['application/json; charset=UTF-8'])  # noqa: E501

    # Authentication setting
    auth_settings = ['oauth2']  # noqa: E501

    return self.api_client.call_api(
        '/teams/{team_gid}', 'GET',
        path_params,
        query_params,
        header_params,
        body=body_params,
        post_params=form_params,
        files=local_var_files,
        response_type='TeamResponseData',  # noqa: E501
        auth_settings=auth_settings,
        async_req=params.get('async_req'),
        _return_http_data_only=params.get('_return_http_data_only'),
        _preload_content=params.get('_preload_content', True),
        _request_timeout=params.get('_request_timeout'),
        collection_formats=collection_formats)

def get_teams_for_user(self, user_gid, organization, **kwargs):  # noqa: E501
    """Get teams for a user  # noqa: E501

    Returns the compact records for all teams to which the given user is assigned.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.get_teams_for_user(user_gid, organization, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required)
    :param str organization: The workspace or organization to filter teams on. (required)
    :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100.
    :param str offset: Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseArray
                If the method is called asynchronously,
                returns the request thread.
    """
    kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True)
    if kwargs.get('async_req'):
        return self.get_teams_for_user_with_http_info(user_gid, organization, **kwargs)  # noqa: E501
    else:
        (data) = self.get_teams_for_user_with_http_info(user_gid, organization, **kwargs)  # noqa: E501
        return data

def get_teams_for_user_with_http_info(self, user_gid, organization, **kwargs):  # noqa: E501
    """Get teams for a user  # noqa: E501

    Returns the compact records for all teams to which the given user is assigned.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.get_teams_for_user_with_http_info(user_gid, organization, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required)
    :param str organization: The workspace or organization to filter teams on. (required)
    :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100.
    :param str offset: Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseArray
                If the method is called asynchronously,
                returns the request thread.
    """

    all_params = ['user_gid', 'organization', 'limit', 'offset', 'opt_fields']  # noqa: E501
    all_params.append('async_req')
    all_params.append('header_params')
    all_params.append('_return_http_data_only')
    all_params.append('_preload_content')
    all_params.append('_request_timeout')

    params = locals()
    for key, val in six.iteritems(params['kwargs']):
        if key not in all_params:
            raise TypeError(
                "Got an unexpected keyword argument '%s'"
                " to method get_teams_for_user" % key
            )
        params[key] = val
    del params['kwargs']
    # verify the required parameter 'user_gid' is set
    if ('user_gid' not in params or
            params['user_gid'] is None):
        raise ValueError("Missing the required parameter `user_gid` when calling `get_teams_for_user`")  # noqa: E501
    # verify the required parameter 'organization' is set
    if ('organization' not in params or
            params['organization'] is None):
        raise ValueError("Missing the required parameter `organization` when calling `get_teams_for_user`")  # noqa: E501

    collection_formats = {}

    path_params = {}
    if 'user_gid' in params:
        path_params['user_gid'] = params['user_gid']  # noqa: E501

    query_params = []
    if 'limit' in params:
        query_params.append(('limit', params['limit']))  # noqa: E501
    if 'offset' in params:
        query_params.append(('offset', params['offset']))  # noqa: E501
    if 'organization' in params:
        query_params.append(('organization', params['organization']))  # noqa: E501
    if 'opt_fields' in params:
        query_params.append(('opt_fields', params['opt_fields']))  # noqa: E501
        collection_formats['opt_fields'] = 'csv'  # noqa: E501

    header_params = kwargs.get("header_params", {})

    form_params = []
    local_var_files = {}

    body_params = None
    # HTTP header `Accept`
    header_params['Accept'] = self.api_client.select_header_accept(
        ['application/json; charset=UTF-8'])  # noqa: E501

    # Authentication setting
    auth_settings = ['oauth2']  # noqa: E501

    return self.api_client.call_api(
        '/users/{user_gid}/teams', 'GET',
        path_params,
        query_params,
        header_params,
        body=body_params,
        post_params=form_params,
        files=local_var_files,
        response_type='TeamResponseArray',  # noqa: E501
        auth_settings=auth_settings,
        async_req=params.get('async_req'),
        _return_http_data_only=params.get('_return_http_data_only'),
        _preload_content=params.get('_preload_content', True),
        _request_timeout=params.get('_request_timeout'),
        collection_formats=collection_formats)

def get_teams_for_workspace(self, workspace_gid, **kwargs):  # noqa: E501
    """Get teams in a workspace  # noqa: E501

    Returns the compact records for all teams in the workspace visible to the authorized user.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.get_teams_for_workspace(workspace_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param str workspace_gid: Globally unique identifier for the workspace or organization. (required)
    :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100.
    :param str offset: Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseArray
                If the method is called asynchronously,
                returns the request thread.
    """
    kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True)
    if kwargs.get('async_req'):
        return self.get_teams_for_workspace_with_http_info(workspace_gid, **kwargs)  # noqa: E501
    else:
        (data) = self.get_teams_for_workspace_with_http_info(workspace_gid, **kwargs)  # noqa: E501
        return data

def get_teams_for_workspace_with_http_info(self, workspace_gid, **kwargs):  # noqa: E501
    """Get teams in a workspace  # noqa: E501

    Returns the compact records for all teams in the workspace visible to the authorized user.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.get_teams_for_workspace_with_http_info(workspace_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param str workspace_gid: Globally unique identifier for the workspace or organization. (required)
    :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100.
    :param str offset: Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseArray
                If the method is called asynchronously,
                returns the request thread.
    """

    all_params = ['workspace_gid', 'limit', 'offset', 'opt_fields']  # noqa: E501
    all_params.append('async_req')
    all_params.append('header_params')
    all_params.append('_return_http_data_only')
    all_params.append('_preload_content')
    all_params.append('_request_timeout')

    params = locals()
    for key, val in six.iteritems(params['kwargs']):
        if key not in all_params:
            raise TypeError(
                "Got an unexpected keyword argument '%s'"
                " to method get_teams_for_workspace" % key
            )
        params[key] = val
    del params['kwargs']
    # verify the required parameter 'workspace_gid' is set
    if ('workspace_gid' not in params or
            params['workspace_gid'] is None):
        raise ValueError("Missing the required parameter `workspace_gid` when calling `get_teams_for_workspace`")  # noqa: E501

    collection_formats = {}

    path_params = {}
    if 'workspace_gid' in params:
        path_params['workspace_gid'] = params['workspace_gid']  # noqa: E501

    query_params = []
    if 'limit' in params:
        query_params.append(('limit', params['limit']))  # noqa: E501
    if 'offset' in params:
        query_params.append(('offset', params['offset']))  # noqa: E501
    if 'opt_fields' in params:
        query_params.append(('opt_fields', params['opt_fields']))  # noqa: E501
        collection_formats['opt_fields'] = 'csv'  # noqa: E501

    header_params = kwargs.get("header_params", {})

    form_params = []
    local_var_files = {}

    body_params = None
    # HTTP header `Accept`
    header_params['Accept'] = self.api_client.select_header_accept(
        ['application/json; charset=UTF-8'])  # noqa: E501

    # Authentication setting
    auth_settings = ['oauth2']  # noqa: E501

    return self.api_client.call_api(
        '/workspaces/{workspace_gid}/teams', 'GET',
        path_params,
        query_params,
        header_params,
        body=body_params,
        post_params=form_params,
        files=local_var_files,
        response_type='TeamResponseArray',  # noqa: E501
        auth_settings=auth_settings,
        async_req=params.get('async_req'),
        _return_http_data_only=params.get('_return_http_data_only'),
        _preload_content=params.get('_preload_content', True),
        _request_timeout=params.get('_request_timeout'),
        collection_formats=collection_formats)

def remove_user_for_team(self, body, team_gid, **kwargs):  # noqa: E501
    """Remove a user from a team  # noqa: E501

    The user making this call must be a member of the team in order to remove themselves or others.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.remove_user_for_team(body, team_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param TeamGidRemoveUserBody body: The user to remove from the team. (required)
    :param str team_gid: Globally unique identifier for the team. (required)
    :return: EmptyResponseData
                If the method is called asynchronously,
                returns the request thread.
    """
    kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True)
    if kwargs.get('async_req'):
        return self.remove_user_for_team_with_http_info(body, team_gid, **kwargs)  # noqa: E501
    else:
        (data) = self.remove_user_for_team_with_http_info(body, team_gid, **kwargs)  # noqa: E501
        return data

def remove_user_for_team_with_http_info(self, body, team_gid, **kwargs):  # noqa: E501
    """Remove a user from a team  # noqa: E501

    The user making this call must be a member of the team in order to remove themselves or others.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.remove_user_for_team_with_http_info(body, team_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param TeamGidRemoveUserBody body: The user to remove from the team. (required)
    :param str team_gid: Globally unique identifier for the team. (required)
    :return: EmptyResponseData
                If the method is called asynchronously,
                returns the request thread.
    """

    all_params = ['body', 'team_gid']  # noqa: E501
    all_params.append('async_req')
    all_params.append('header_params')
    all_params.append('_return_http_data_only')
    all_params.append('_preload_content')
    all_params.append('_request_timeout')

    params = locals()
    for key, val in six.iteritems(params['kwargs']):
        if key not in all_params:
            raise TypeError(
                "Got an unexpected keyword argument '%s'"
                " to method remove_user_for_team" % key
            )
        params[key] = val
    del params['kwargs']
    # verify the required parameter 'body' is set
    if ('body' not in params or
            params['body'] is None):
        raise ValueError("Missing the required parameter `body` when calling `remove_user_for_team`")  # noqa: E501
    # verify the required parameter 'team_gid' is set
    if ('team_gid' not in params or
            params['team_gid'] is None):
        raise ValueError("Missing the required parameter `team_gid` when calling `remove_user_for_team`")  # noqa: E501

    collection_formats = {}

    path_params = {}
    if 'team_gid' in params:
        path_params['team_gid'] = params['team_gid']  # noqa: E501

    query_params = []

    header_params = kwargs.get("header_params", {})

    form_params = []
    local_var_files = {}

    body_params = None
    if 'body' in params:
        body_params = params['body']
    # HTTP header `Accept`
    header_params['Accept'] = self.api_client.select_header_accept(
        ['application/json; charset=UTF-8'])  # noqa: E501

    # HTTP header `Content-Type`
    header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
        ['application/json; charset=UTF-8'])  # noqa: E501

    # Authentication setting
    auth_settings = ['oauth2']  # noqa: E501

    return self.api_client.call_api(
        '/teams/{team_gid}/removeUser', 'POST',
        path_params,
        query_params,
        header_params,
        body=body_params,
        post_params=form_params,
        files=local_var_files,
        response_type='EmptyResponseData',  # noqa: E501
        auth_settings=auth_settings,
        async_req=params.get('async_req'),
        _return_http_data_only=params.get('_return_http_data_only'),
        _preload_content=params.get('_preload_content', True),
        _request_timeout=params.get('_request_timeout'),
        collection_formats=collection_formats)

def update_team(self, body, team_gid, **kwargs):  # noqa: E501
    """Update a team  # noqa: E501

    Updates a team within the current workspace.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.update_team(body, team_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param TeamsTeamGidBody body: The team to update. (required)
    :param str team_gid: Globally unique identifier for the team. (required)
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseData
                If the method is called asynchronously,
                returns the request thread.
    """
    kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True)
    if kwargs.get('async_req'):
        return self.update_team_with_http_info(body, team_gid, **kwargs)  # noqa: E501
    else:
        (data) = self.update_team_with_http_info(body, team_gid, **kwargs)  # noqa: E501
        return data

def update_team_with_http_info(self, body, team_gid, **kwargs):  # noqa: E501
    """Update a team  # noqa: E501

    Updates a team within the current workspace.  # noqa: E501
    This method makes a synchronous HTTP request by default. To make an
    asynchronous HTTP request, please pass async_req=True
    >>> thread = api.update_team_with_http_info(body, team_gid, async_req=True)
    >>> result = thread.get()

    :param async_req bool
    :param TeamsTeamGidBody body: The team to update. (required)
    :param str team_gid: Globally unique identifier for the team. (required)
    :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    :return: TeamResponseData
                If the method is called asynchronously,
                returns the request thread.
    """

    all_params = ['body', 'team_gid', 'opt_fields']  # noqa: E501
    all_params.append('async_req')
    all_params.append('header_params')
    all_params.append('_return_http_data_only')
    all_params.append('_preload_content')
    all_params.append('_request_timeout')

    params = locals()
    for key, val in six.iteritems(params['kwargs']):
        if key not in all_params:
            raise TypeError(
                "Got an unexpected keyword argument '%s'"
                " to method update_team" % key
            )
        params[key] = val
    del params['kwargs']
    # verify the required parameter 'body' is set
    if ('body' not in params or
            params['body'] is None):
        raise ValueError("Missing the required parameter `body` when calling `update_team`")  # noqa: E501
    # verify the required parameter 'team_gid' is set
    if ('team_gid' not in params or
            params['team_gid'] is None):
        raise ValueError("Missing the required parameter `team_gid` when calling `update_team`")  # noqa: E501

    collection_formats = {}

    path_params = {}
    if 'team_gid' in params:
        path_params['team_gid'] = params['team_gid']  # noqa: E501

    query_params = []
    if 'opt_fields' in params:
        query_params.append(('opt_fields', params['opt_fields']))  # noqa: E501
        collection_formats['opt_fields'] = 'csv'  # noqa: E501

    header_params = kwargs.get("header_params", {})

    form_params = []
    local_var_files = {}

    body_params = None
    if 'body' in params:
        body_params = params['body']
    # HTTP header `Accept`
    header_params['Accept'] = self.api_client.select_header_accept(
        ['application/json; charset=UTF-8'])  # noqa: E501

    # HTTP header `Content-Type`
    header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
        ['application/json; charset=UTF-8'])  # noqa: E501

    # Authentication setting
    auth_settings = ['oauth2']  # noqa: E501

    return self.api_client.call_api(
        '/teams/{team_gid}', 'PUT',
        path_params,
        query_params,
        header_params,
        body=body_params,
        post_params=form_params,
        files=local_var_files,
        response_type='TeamResponseData',  # noqa: E501
        auth_settings=auth_settings,
        async_req=params.get('async_req'),
        _return_http_data_only=params.get('_return_http_data_only'),
        _preload_content=params.get('_preload_content', True),
        _request_timeout=params.get('_request_timeout'),
        collection_formats=collection_formats)
