# coding: utf-8

"""
    Collibra Data Governance Center Core API

    <p>The Core REST API allows you to create your own integrations with Collibra Data Governance Center.</p><p><i>Create custom applications to help users get access to the right data.</i></p>  # noqa: E501

    OpenAPI spec version: 2.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 collibra_core.api_client import ApiClient


class CommunitiesApi(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_communities(self, **kwargs):  # noqa: E501
        """Add multiple communities  # noqa: E501

        Adds multiple communities with the given parameters  # 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_communities(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[AddCommunityRequest] body: List of the properties of the communities to be added.
        :return: list[CommunityImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.add_communities_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.add_communities_with_http_info(**kwargs)  # noqa: E501
            return data

    def add_communities_with_http_info(self, **kwargs):  # noqa: E501
        """Add multiple communities  # noqa: E501

        Adds multiple communities with the given parameters  # 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_communities_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[AddCommunityRequest] body: List of the properties of the communities to be added.
        :return: list[CommunityImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        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_communities" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        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'])  # noqa: E501

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

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

        return self.api_client.call_api(
            '/communities/bulk', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[CommunityImpl]',  # 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 add_community(self, **kwargs):  # noqa: E501
        """Add community  # noqa: E501

        Adds a new community with the given parameters.  # 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_community(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddCommunityRequest body: the properties of the community to be added
        :return: CommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.add_community_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.add_community_with_http_info(**kwargs)  # noqa: E501
            return data

    def add_community_with_http_info(self, **kwargs):  # noqa: E501
        """Add community  # noqa: E501

        Adds a new community with the given parameters.  # 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_community_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param AddCommunityRequest body: the properties of the community to be added
        :return: CommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        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_community" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        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'])  # noqa: E501

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

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

        return self.api_client.call_api(
            '/communities', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CommunityImpl',  # 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 change_communities(self, **kwargs):  # noqa: E501
        """Change multiple communities  # noqa: E501

        Changes multiple communities using the given request parameters  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_communities(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[ChangeCommunityRequest] body: List of the properties of the communities to be changed.
        :return: list[CommunityImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.change_communities_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.change_communities_with_http_info(**kwargs)  # noqa: E501
            return data

    def change_communities_with_http_info(self, **kwargs):  # noqa: E501
        """Change multiple communities  # noqa: E501

        Changes multiple communities using the given request parameters  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_communities_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[ChangeCommunityRequest] body: List of the properties of the communities to be changed.
        :return: list[CommunityImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        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 change_communities" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        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'])  # noqa: E501

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

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

        return self.api_client.call_api(
            '/communities/bulk', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[CommunityImpl]',  # 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 change_community(self, community_id, **kwargs):  # noqa: E501
        """Change community  # noqa: E501

        Changes the community with the information that is present in the request. Only properties that are specified in this request and have non-<code>null</code> values are updated. All other properties are ignored.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_community(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: the id of the community to be changed. (required)
        :param ChangeCommunityRequest body: the properties of the community to be changed
        :return: CommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.change_community_with_http_info(community_id, **kwargs)  # noqa: E501
        else:
            (data) = self.change_community_with_http_info(community_id, **kwargs)  # noqa: E501
            return data

    def change_community_with_http_info(self, community_id, **kwargs):  # noqa: E501
        """Change community  # noqa: E501

        Changes the community with the information that is present in the request. Only properties that are specified in this request and have non-<code>null</code> values are updated. All other properties are ignored.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_community_with_http_info(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: the id of the community to be changed. (required)
        :param ChangeCommunityRequest body: the properties of the community to be changed
        :return: CommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['community_id', 'body']  # noqa: E501
        all_params.append('async_req')
        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 change_community" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'community_id' is set
        if ('community_id' not in params or
                params['community_id'] is None):
            raise ValueError("Missing the required parameter `community_id` when calling `change_community`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        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'])  # noqa: E501

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

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

        return self.api_client.call_api(
            '/communities/{communityId}', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CommunityImpl',  # 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 change_to_root_community(self, community_id, **kwargs):  # noqa: E501
        """Change to root community  # noqa: E501

        Changes the community with given ID to a root community.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_to_root_community(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: The ID of the community that will be changed to a root community (required)
        :return: CommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.change_to_root_community_with_http_info(community_id, **kwargs)  # noqa: E501
        else:
            (data) = self.change_to_root_community_with_http_info(community_id, **kwargs)  # noqa: E501
            return data

    def change_to_root_community_with_http_info(self, community_id, **kwargs):  # noqa: E501
        """Change to root community  # noqa: E501

        Changes the community with given ID to a root community.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_to_root_community_with_http_info(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: The ID of the community that will be changed to a root community (required)
        :return: CommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['community_id']  # noqa: E501
        all_params.append('async_req')
        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 change_to_root_community" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'community_id' is set
        if ('community_id' not in params or
                params['community_id'] is None):
            raise ValueError("Missing the required parameter `community_id` when calling `change_to_root_community`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/communities/{communityId}/root', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CommunityImpl',  # 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 find_communities(self, sort_field, **kwargs):  # noqa: E501
        """Find communities  # noqa: E501

        Returns communities matching the given search criteria. Only parameters that are specified in this request and have non-<code>null</code> values are used for filtering. All other parameters are ignored. By default a result containing 1000 communities is returned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.find_communities(sort_field, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str sort_field: The field on which the results are sorted. (required)
        :param int offset: The first result to retrieve. If not set (offset = <code>0</code>), results will be retrieved starting from row <code>0</code>. Cursor should be preferred over offset for better performance and stable results. It is forbidden to use both in the same request.
        :param int limit: The maximum number of results to retrieve. If not set (limit = <code>0</code>), the default limit will be used. The maximum allowed limit is 1000.
        :param int count_limit: Allows to limit the number of elements that will be counted. -1 will count everything and 0 will cause the count to be skipped. For cursor pagination this parameter is ignored and count is skipped.
        :param str cursor: Cursor for the current page of results. To retrieve the first page with cursor pagination you need to pass this parameter with an empty value (must be non-null). For the next pages, the value must be taken from the response (<code>nextCursor</code> property).
        :param str name: The name of the community to search for.
        :param str name_match_mode: The match mode used to compare <code>name</code>. If the match mode is <code>EXACT</code> the search is case-sensitive, otherwise the search is case-insensitive.
        :param str parent_id: The ID of the parent community to find the communities in.
        :param bool exclude_meta: The exclude meta flag. If this is set to true then the meta communities will not be returned (meta communities are i.e. communities not created manually by the user).
        :param str sort_order: The sorting order.
        :return: CommunityPagedResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.find_communities_with_http_info(sort_field, **kwargs)  # noqa: E501
        else:
            (data) = self.find_communities_with_http_info(sort_field, **kwargs)  # noqa: E501
            return data

    def find_communities_with_http_info(self, sort_field, **kwargs):  # noqa: E501
        """Find communities  # noqa: E501

        Returns communities matching the given search criteria. Only parameters that are specified in this request and have non-<code>null</code> values are used for filtering. All other parameters are ignored. By default a result containing 1000 communities is returned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.find_communities_with_http_info(sort_field, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str sort_field: The field on which the results are sorted. (required)
        :param int offset: The first result to retrieve. If not set (offset = <code>0</code>), results will be retrieved starting from row <code>0</code>. Cursor should be preferred over offset for better performance and stable results. It is forbidden to use both in the same request.
        :param int limit: The maximum number of results to retrieve. If not set (limit = <code>0</code>), the default limit will be used. The maximum allowed limit is 1000.
        :param int count_limit: Allows to limit the number of elements that will be counted. -1 will count everything and 0 will cause the count to be skipped. For cursor pagination this parameter is ignored and count is skipped.
        :param str cursor: Cursor for the current page of results. To retrieve the first page with cursor pagination you need to pass this parameter with an empty value (must be non-null). For the next pages, the value must be taken from the response (<code>nextCursor</code> property).
        :param str name: The name of the community to search for.
        :param str name_match_mode: The match mode used to compare <code>name</code>. If the match mode is <code>EXACT</code> the search is case-sensitive, otherwise the search is case-insensitive.
        :param str parent_id: The ID of the parent community to find the communities in.
        :param bool exclude_meta: The exclude meta flag. If this is set to true then the meta communities will not be returned (meta communities are i.e. communities not created manually by the user).
        :param str sort_order: The sorting order.
        :return: CommunityPagedResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['sort_field', 'offset', 'limit', 'count_limit', 'cursor', 'name', 'name_match_mode', 'parent_id', 'exclude_meta', 'sort_order']  # noqa: E501
        all_params.append('async_req')
        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 find_communities" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'sort_field' is set
        if ('sort_field' not in params or
                params['sort_field'] is None):
            raise ValueError("Missing the required parameter `sort_field` when calling `find_communities`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'count_limit' in params:
            query_params.append(('countLimit', params['count_limit']))  # noqa: E501
        if 'cursor' in params:
            query_params.append(('cursor', params['cursor']))  # noqa: E501
        if 'name' in params:
            query_params.append(('name', params['name']))  # noqa: E501
        if 'name_match_mode' in params:
            query_params.append(('nameMatchMode', params['name_match_mode']))  # noqa: E501
        if 'parent_id' in params:
            query_params.append(('parentId', params['parent_id']))  # noqa: E501
        if 'exclude_meta' in params:
            query_params.append(('excludeMeta', params['exclude_meta']))  # noqa: E501
        if 'sort_field' in params:
            query_params.append(('sortField', params['sort_field']))  # noqa: E501
        if 'sort_order' in params:
            query_params.append(('sortOrder', params['sort_order']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/communities', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CommunityPagedResponse',  # 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_community(self, community_id, **kwargs):  # noqa: E501
        """Get community  # noqa: E501

        Returns the community with the given ID.  # 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_community(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: the ID of the community (required)
        :return: CommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_community_with_http_info(community_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_community_with_http_info(community_id, **kwargs)  # noqa: E501
            return data

    def get_community_with_http_info(self, community_id, **kwargs):  # noqa: E501
        """Get community  # noqa: E501

        Returns the community with the given ID.  # 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_community_with_http_info(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: the ID of the community (required)
        :return: CommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['community_id']  # noqa: E501
        all_params.append('async_req')
        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_community" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'community_id' is set
        if ('community_id' not in params or
                params['community_id'] is None):
            raise ValueError("Missing the required parameter `community_id` when calling `get_community`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/communities/{communityId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CommunityImpl',  # 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_community_breadcrumb(self, community_id, **kwargs):  # noqa: E501
        """Get community breadcrumb  # noqa: E501

        Returns the list of communities that lead to the community identified by the given ID.  # 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_community_breadcrumb(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: The ID of the community (required)
        :return: list[NamedResourceReferenceImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_community_breadcrumb_with_http_info(community_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_community_breadcrumb_with_http_info(community_id, **kwargs)  # noqa: E501
            return data

    def get_community_breadcrumb_with_http_info(self, community_id, **kwargs):  # noqa: E501
        """Get community breadcrumb  # noqa: E501

        Returns the list of communities that lead to the community identified by the given ID.  # 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_community_breadcrumb_with_http_info(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: The ID of the community (required)
        :return: list[NamedResourceReferenceImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['community_id']  # noqa: E501
        all_params.append('async_req')
        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_community_breadcrumb" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'community_id' is set
        if ('community_id' not in params or
                params['community_id'] is None):
            raise ValueError("Missing the required parameter `community_id` when calling `get_community_breadcrumb`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/communities/{communityId}/breadcrumb', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[NamedResourceReferenceImpl]',  # 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_communities(self, **kwargs):  # noqa: E501
        """Remove multiple communities  # noqa: E501

        This endpoint will be removed in the future. Please use POST /communities/removalJobs.  # 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_communities(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[str] body: the IDs of the communities to be removed, i.e. ["6f685f90-1036-4d30-983a-a9bbcdd7b8f6", "6f685f90-1036-4d30-983a-a9bbcdd7b123"]
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.remove_communities_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.remove_communities_with_http_info(**kwargs)  # noqa: E501
            return data

    def remove_communities_with_http_info(self, **kwargs):  # noqa: E501
        """Remove multiple communities  # noqa: E501

        This endpoint will be removed in the future. Please use POST /communities/removalJobs.  # 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_communities_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[str] body: the IDs of the communities to be removed, i.e. ["6f685f90-1036-4d30-983a-a9bbcdd7b8f6", "6f685f90-1036-4d30-983a-a9bbcdd7b123"]
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        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_communities" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

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

        return self.api_client.call_api(
            '/communities/bulk', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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_communities_in_job(self, **kwargs):  # noqa: E501
        """Remove multiple communities asynchronously  # noqa: E501

        Removes multiple communities in a job.  # 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_communities_in_job(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[str] body: the IDs of the communities to be removed, i.e. ["6f685f90-1036-4d30-983a-a9bbcdd7b8f6", "6f685f90-1036-4d30-983a-a9bbcdd7b123"]
        :return: Job
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.remove_communities_in_job_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.remove_communities_in_job_with_http_info(**kwargs)  # noqa: E501
            return data

    def remove_communities_in_job_with_http_info(self, **kwargs):  # noqa: E501
        """Remove multiple communities asynchronously  # noqa: E501

        Removes multiple communities in a job.  # 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_communities_in_job_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[str] body: the IDs of the communities to be removed, i.e. ["6f685f90-1036-4d30-983a-a9bbcdd7b8f6", "6f685f90-1036-4d30-983a-a9bbcdd7b123"]
        :return: Job
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        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_communities_in_job" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        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'])  # noqa: E501

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

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

        return self.api_client.call_api(
            '/communities/removalJobs', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Job',  # 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_community(self, community_id, **kwargs):  # noqa: E501
        """Remove community  # noqa: E501

        This endpoint will be removed in the future. Please use POST /communities/removalJobs  # 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_community(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: the ID of the community to remove (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.remove_community_with_http_info(community_id, **kwargs)  # noqa: E501
        else:
            (data) = self.remove_community_with_http_info(community_id, **kwargs)  # noqa: E501
            return data

    def remove_community_with_http_info(self, community_id, **kwargs):  # noqa: E501
        """Remove community  # noqa: E501

        This endpoint will be removed in the future. Please use POST /communities/removalJobs  # 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_community_with_http_info(community_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str community_id: the ID of the community to remove (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['community_id']  # noqa: E501
        all_params.append('async_req')
        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_community" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'community_id' is set
        if ('community_id' not in params or
                params['community_id'] is None):
            raise ValueError("Missing the required parameter `community_id` when calling `remove_community`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/communities/{communityId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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)
