# coding: utf-8

"""
    \"Data Governance Center: REST API v2\"

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # 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 swagger_client.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 resource_community_resource_add_communities_post(self, **kwargs):  # noqa: E501
        """Adds multiple communities.  # noqa: E501

        Adds multiple communities.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_add_communities_post(async=True)
        >>> result = thread.get()

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

    def resource_community_resource_add_communities_post_with_http_info(self, **kwargs):  # noqa: E501
        """Adds multiple communities.  # noqa: E501

        Adds multiple communities.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_add_communities_post_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :param list[JsonAddCommunityRequest] body: the properties of the communities to be added
        :return: list[JsonCommunityImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async')
        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 resource_community_resource_add_communities_post" % 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 = []  # 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[JsonCommunityImpl]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_community_resource_add_community_post(self, **kwargs):  # noqa: E501
        """Adds new community.  # noqa: E501

        Adds new community.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_add_community_post(async=True)
        >>> result = thread.get()

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

    def resource_community_resource_add_community_post_with_http_info(self, **kwargs):  # noqa: E501
        """Adds new community.  # noqa: E501

        Adds new community.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_add_community_post_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :param JsonAddCommunityRequest body: the properties of the community to be added
        :return: JsonCommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async')
        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 resource_community_resource_add_community_post" % 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 = []  # 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='JsonCommunityImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_community_resource_change_communities_patch(self, **kwargs):  # noqa: E501
        """Changes multiple communities.  # noqa: E501

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

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

    def resource_community_resource_change_communities_patch_with_http_info(self, **kwargs):  # noqa: E501
        """Changes multiple communities.  # noqa: E501

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

        :param async bool
        :param list[JsonChangeCommunityRequest] body: the properties of the communities to be changed
        :return: list[JsonCommunityImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async')
        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 resource_community_resource_change_communities_patch" % 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 = []  # 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[JsonCommunityImpl]',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_community_resource_change_community_patch(self, community_id, **kwargs):  # noqa: E501
        """Changes the community with the information that is present in the request.  # noqa: E501

        Changes the community with the information that is present in the request. Only properties that are specified in this request and have not <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=True
        >>> thread = api.resource_community_resource_change_community_patch(community_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str community_id: the <code>id</code> of the community to be changed (required)
        :param JsonChangeCommunityRequest body: the properties of the community to be changed
        :return: JsonCommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_community_resource_change_community_patch_with_http_info(community_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_community_resource_change_community_patch_with_http_info(community_id, **kwargs)  # noqa: E501
            return data

    def resource_community_resource_change_community_patch_with_http_info(self, community_id, **kwargs):  # noqa: E501
        """Changes the community with the information that is present in the request.  # noqa: E501

        Changes the community with the information that is present in the request. Only properties that are specified in this request and have not <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=True
        >>> thread = api.resource_community_resource_change_community_patch_with_http_info(community_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str community_id: the <code>id</code> of the community to be changed (required)
        :param JsonChangeCommunityRequest body: the properties of the community to be changed
        :return: JsonCommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['community_id', 'body']  # noqa: E501
        all_params.append('async')
        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 resource_community_resource_change_community_patch" % 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 `resource_community_resource_change_community_patch`")  # 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 = []  # 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='JsonCommunityImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_community_resource_find_communities_get(self, **kwargs):  # noqa: E501
        """Returns communities matching the given search criteria.  # noqa: E501

        Returns communities matching the given search criteria. Only parameters that are specified in this request and have not <code>null</code> values are used for filtering. All other parameters are ignored. The returned communities satisfy all constraints that are specified in this search criteria. 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=True
        >>> thread = api.resource_community_resource_find_communities_get(async=True)
        >>> result = thread.get()

        :param async bool
        :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 int limit: The maximum number of results to retrieve. If not set (value = <tt>0</tt>), the default limit will be used
        :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>
        :param int offset: The first result to retrieve. If not set (value = <tt>0</tt>), results will be retrieved starting from row <tt>0</tt>
        :param str parent_id: The <code>id</code> of the parent community to find the communities in
        :param str sort_field: The field on which the results are sorted
        :param str sort_order: The sorting order
        :return: JsonPagedResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_community_resource_find_communities_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.resource_community_resource_find_communities_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def resource_community_resource_find_communities_get_with_http_info(self, **kwargs):  # noqa: E501
        """Returns communities matching the given search criteria.  # noqa: E501

        Returns communities matching the given search criteria. Only parameters that are specified in this request and have not <code>null</code> values are used for filtering. All other parameters are ignored. The returned communities satisfy all constraints that are specified in this search criteria. 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=True
        >>> thread = api.resource_community_resource_find_communities_get_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :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 int limit: The maximum number of results to retrieve. If not set (value = <tt>0</tt>), the default limit will be used
        :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>
        :param int offset: The first result to retrieve. If not set (value = <tt>0</tt>), results will be retrieved starting from row <tt>0</tt>
        :param str parent_id: The <code>id</code> of the parent community to find the communities in
        :param str sort_field: The field on which the results are sorted
        :param str sort_order: The sorting order
        :return: JsonPagedResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['exclude_meta', 'limit', 'name', 'name_match_mode', 'offset', 'parent_id', 'sort_field', 'sort_order']  # noqa: E501
        all_params.append('async')
        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 resource_community_resource_find_communities_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'exclude_meta' in params:
            query_params.append(('excludeMeta', params['exclude_meta']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # 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 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'parent_id' in params:
            query_params.append(('parentId', params['parent_id']))  # 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 = []  # 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='JsonPagedResponse',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_community_resource_get_community_get(self, community_id, **kwargs):  # noqa: E501
        """Returns community identified by given id.  # noqa: E501

        Returns community identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_get_community_get(community_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str community_id: the <code>id</code> of the community (required)
        :return: JsonCommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_community_resource_get_community_get_with_http_info(community_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_community_resource_get_community_get_with_http_info(community_id, **kwargs)  # noqa: E501
            return data

    def resource_community_resource_get_community_get_with_http_info(self, community_id, **kwargs):  # noqa: E501
        """Returns community identified by given id.  # noqa: E501

        Returns community identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_get_community_get_with_http_info(community_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str community_id: the <code>id</code> of the community (required)
        :return: JsonCommunityImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['community_id']  # noqa: E501
        all_params.append('async')
        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 resource_community_resource_get_community_get" % 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 `resource_community_resource_get_community_get`")  # 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 = []  # 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='JsonCommunityImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_community_resource_remove_communities_delete(self, **kwargs):  # noqa: E501
        """Removes multiple communities.  # noqa: E501

        Removes multiple communities.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_remove_communities_delete(async=True)
        >>> result = thread.get()

        :param async bool
        :param list[str] body: the <code>id</code>s 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'):
            return self.resource_community_resource_remove_communities_delete_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.resource_community_resource_remove_communities_delete_with_http_info(**kwargs)  # noqa: E501
            return data

    def resource_community_resource_remove_communities_delete_with_http_info(self, **kwargs):  # noqa: E501
        """Removes multiple communities.  # noqa: E501

        Removes multiple communities.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_remove_communities_delete_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :param list[str] body: the <code>id</code>s 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')
        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 resource_community_resource_remove_communities_delete" % 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 = []  # 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=params.get('async'),
            _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 resource_community_resource_remove_communities_in_job_post(self, **kwargs):  # noqa: E501
        """Removes multiple communities in job.  # noqa: E501

        Removes multiple communities in job.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_remove_communities_in_job_post(async=True)
        >>> result = thread.get()

        :param async bool
        :param list[str] body: the <code>id</code>s of the communities to be removed, i.e. [\"6f685f90-1036-4d30-983a-a9bbcdd7b8f6\", \"6f685f90-1036-4d30-983a-a9bbcdd7b123\"]
        :return: JsonJobImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_community_resource_remove_communities_in_job_post_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.resource_community_resource_remove_communities_in_job_post_with_http_info(**kwargs)  # noqa: E501
            return data

    def resource_community_resource_remove_communities_in_job_post_with_http_info(self, **kwargs):  # noqa: E501
        """Removes multiple communities in job.  # noqa: E501

        Removes multiple communities in job.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_remove_communities_in_job_post_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :param list[str] body: the <code>id</code>s of the communities to be removed, i.e. [\"6f685f90-1036-4d30-983a-a9bbcdd7b8f6\", \"6f685f90-1036-4d30-983a-a9bbcdd7b123\"]
        :return: JsonJobImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async')
        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 resource_community_resource_remove_communities_in_job_post" % 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 = []  # 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='JsonJobImpl',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 resource_community_resource_remove_community_delete(self, community_id, **kwargs):  # noqa: E501
        """Removes community identified by given id.  # noqa: E501

        Removes community identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_remove_community_delete(community_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str community_id: the <code>id</code> of the community (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.resource_community_resource_remove_community_delete_with_http_info(community_id, **kwargs)  # noqa: E501
        else:
            (data) = self.resource_community_resource_remove_community_delete_with_http_info(community_id, **kwargs)  # noqa: E501
            return data

    def resource_community_resource_remove_community_delete_with_http_info(self, community_id, **kwargs):  # noqa: E501
        """Removes community identified by given id.  # noqa: E501

        Removes community identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.resource_community_resource_remove_community_delete_with_http_info(community_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param str community_id: the <code>id</code> of the community (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['community_id']  # noqa: E501
        all_params.append('async')
        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 resource_community_resource_remove_community_delete" % 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 `resource_community_resource_remove_community_delete`")  # 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 = []  # 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=params.get('async'),
            _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)
