# coding: utf-8

"""
    vault/kernel/core_api/proto/v1/accounts/core_api_account_schedule_tags.proto

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: version not set
    
    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 common.vault.oas.api_client import ApiClient


class CoreAPIRestrictionsApi(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 batch_get_restriction_set_definition_versions(self, ids, **kwargs):  # noqa: E501
        """Retrieves one or more restriction set definition versions using the restriction set definition version IDs.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.batch_get_restriction_set_definition_versions(ids, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[str] ids: A list of the IDs of restriction set definition versions that are to be retrieved. Required; must be non-empty.  Required. Min length: 1 characters. (required)
        :return: RestrictionsBatchGetRestrictionSetDefinitionVersionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.batch_get_restriction_set_definition_versions_with_http_info(ids, **kwargs)  # noqa: E501
        else:
            (data) = self.batch_get_restriction_set_definition_versions_with_http_info(ids, **kwargs)  # noqa: E501
            return data

    def batch_get_restriction_set_definition_versions_with_http_info(self, ids, **kwargs):  # noqa: E501
        """Retrieves one or more restriction set definition versions using the restriction set definition version IDs.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.batch_get_restriction_set_definition_versions_with_http_info(ids, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[str] ids: A list of the IDs of restriction set definition versions that are to be retrieved. Required; must be non-empty.  Required. Min length: 1 characters. (required)
        :return: RestrictionsBatchGetRestrictionSetDefinitionVersionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'ids' in params:
            query_params.append(('ids', params['ids']))  # noqa: E501
            collection_formats['ids'] = 'multi'  # 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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-set-definition-versions:batchGet', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsBatchGetRestrictionSetDefinitionVersionsResponse',  # 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 batch_get_restriction_sets(self, ids, **kwargs):  # noqa: E501
        """Retrieves one or more restriction sets using the restriction set IDs.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.batch_get_restriction_sets(ids, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[str] ids: A list of the IDs of restriction sets that are to be retrieved. Required; must be non-empty.  Required. Min length: 1 characters. (required)
        :return: RestrictionsBatchGetRestrictionSetsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.batch_get_restriction_sets_with_http_info(ids, **kwargs)  # noqa: E501
        else:
            (data) = self.batch_get_restriction_sets_with_http_info(ids, **kwargs)  # noqa: E501
            return data

    def batch_get_restriction_sets_with_http_info(self, ids, **kwargs):  # noqa: E501
        """Retrieves one or more restriction sets using the restriction set IDs.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.batch_get_restriction_sets_with_http_info(ids, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[str] ids: A list of the IDs of restriction sets that are to be retrieved. Required; must be non-empty.  Required. Min length: 1 characters. (required)
        :return: RestrictionsBatchGetRestrictionSetsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'ids' in params:
            query_params.append(('ids', params['ids']))  # noqa: E501
            collection_formats['ids'] = 'multi'  # 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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-sets:batchGet', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsBatchGetRestrictionSetsResponse',  # 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_restriction_set(self, body, **kwargs):  # noqa: E501
        """Creates a restriction set for the provided 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.create_restriction_set(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RestrictionsCreateRestrictionSetRequest body: (required)
        :return: RestrictionsRestrictionSet
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_restriction_set_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.create_restriction_set_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def create_restriction_set_with_http_info(self, body, **kwargs):  # noqa: E501
        """Creates a restriction set for the provided 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.create_restriction_set_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RestrictionsCreateRestrictionSetRequest body: (required)
        :return: RestrictionsRestrictionSet
                 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 create_restriction_set" % 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_restriction_set`")  # noqa: E501

        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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-sets', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsRestrictionSet',  # 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_restriction_set_definition_version(self, body, **kwargs):  # noqa: E501
        """Creates a restriction set definition version. This creates the restriction set definition if it does not exist.  # 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_restriction_set_definition_version(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RestrictionsCreateRestrictionSetDefinitionVersionRequest body: (required)
        :return: RestrictionsRestrictionSetDefinitionVersion
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_restriction_set_definition_version_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.create_restriction_set_definition_version_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def create_restriction_set_definition_version_with_http_info(self, body, **kwargs):  # noqa: E501
        """Creates a restriction set definition version. This creates the restriction set definition if it does not exist.  # 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_restriction_set_definition_version_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RestrictionsCreateRestrictionSetDefinitionVersionRequest body: (required)
        :return: RestrictionsRestrictionSetDefinitionVersion
                 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 create_restriction_set_definition_version" % 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_restriction_set_definition_version`")  # noqa: E501

        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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-set-definition-versions', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsRestrictionSetDefinitionVersion',  # 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_restriction_set_definition_version2(self, body, restriction_set_definition_version_restriction_set_definition_id, **kwargs):  # noqa: E501
        """Creates a restriction set definition version. This creates the restriction set definition if it does not exist.  # 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_restriction_set_definition_version2(body, restriction_set_definition_version_restriction_set_definition_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RestrictionsCreateRestrictionSetDefinitionVersionRequest body: (required)
        :param str restriction_set_definition_version_restriction_set_definition_id: The ID or name of the restriction set definition this version belongs to. Required for create requests. (required)
        :return: RestrictionsRestrictionSetDefinitionVersion
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_restriction_set_definition_version2_with_http_info(body, restriction_set_definition_version_restriction_set_definition_id, **kwargs)  # noqa: E501
        else:
            (data) = self.create_restriction_set_definition_version2_with_http_info(body, restriction_set_definition_version_restriction_set_definition_id, **kwargs)  # noqa: E501
            return data

    def create_restriction_set_definition_version2_with_http_info(self, body, restriction_set_definition_version_restriction_set_definition_id, **kwargs):  # noqa: E501
        """Creates a restriction set definition version. This creates the restriction set definition if it does not exist.  # 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_restriction_set_definition_version2_with_http_info(body, restriction_set_definition_version_restriction_set_definition_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RestrictionsCreateRestrictionSetDefinitionVersionRequest body: (required)
        :param str restriction_set_definition_version_restriction_set_definition_id: The ID or name of the restriction set definition this version belongs to. Required for create requests. (required)
        :return: RestrictionsRestrictionSetDefinitionVersion
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'restriction_set_definition_version_restriction_set_definition_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 create_restriction_set_definition_version2" % 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_restriction_set_definition_version2`")  # noqa: E501
        # verify the required parameter 'restriction_set_definition_version_restriction_set_definition_id' is set
        if ('restriction_set_definition_version_restriction_set_definition_id' not in params or
                params['restriction_set_definition_version_restriction_set_definition_id'] is None):
            raise ValueError("Missing the required parameter `restriction_set_definition_version_restriction_set_definition_id` when calling `create_restriction_set_definition_version2`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'restriction_set_definition_version_restriction_set_definition_id' in params:
            path_params['restriction_set_definition_version.restriction_set_definition_id'] = params['restriction_set_definition_version_restriction_set_definition_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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-set-definition/{restriction_set_definition_version.restriction_set_definition_id}/versions', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsRestrictionSetDefinitionVersion',  # 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 list_restriction_set_definition_versions(self, **kwargs):  # noqa: E501
        """Lists all the restriction set definition versions sorted by name. This list method does not support pagination, as we believe it will never reach a point where pagination is required, even after many years of use. The restriction set definition versions are sorted by creation time from earliest to latest.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restriction_set_definition_versions(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param bool exclude_previous_versions: Indicates if previous versions should be excluded. Optional; default false.
        :param str restriction_set_definition_id: The restriction set definition ID that the restriction set definition versions must belong to. If empty, all restriction set definitions are returned. Optional for GRPC requests.
        :return: RestrictionsListRestrictionSetDefinitionVersionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_restriction_set_definition_versions_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.list_restriction_set_definition_versions_with_http_info(**kwargs)  # noqa: E501
            return data

    def list_restriction_set_definition_versions_with_http_info(self, **kwargs):  # noqa: E501
        """Lists all the restriction set definition versions sorted by name. This list method does not support pagination, as we believe it will never reach a point where pagination is required, even after many years of use. The restriction set definition versions are sorted by creation time from earliest to latest.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restriction_set_definition_versions_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param bool exclude_previous_versions: Indicates if previous versions should be excluded. Optional; default false.
        :param str restriction_set_definition_id: The restriction set definition ID that the restriction set definition versions must belong to. If empty, all restriction set definitions are returned. Optional for GRPC requests.
        :return: RestrictionsListRestrictionSetDefinitionVersionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['exclude_previous_versions', 'restriction_set_definition_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 list_restriction_set_definition_versions" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'exclude_previous_versions' in params:
            query_params.append(('exclude_previous_versions', params['exclude_previous_versions']))  # noqa: E501
        if 'restriction_set_definition_id' in params:
            query_params.append(('restriction_set_definition_id', params['restriction_set_definition_id']))  # 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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-set-definition-versions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsListRestrictionSetDefinitionVersionsResponse',  # 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 list_restriction_set_definition_versions2(self, restriction_set_definition_id, **kwargs):  # noqa: E501
        """Lists all the restriction set definition versions sorted by name. This list method does not support pagination, as we believe it will never reach a point where pagination is required, even after many years of use. The restriction set definition versions are sorted by creation time from earliest to latest.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restriction_set_definition_versions2(restriction_set_definition_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str restriction_set_definition_id: The restriction set definition ID that the restriction set definition versions must belong to. If empty, all restriction set definitions are returned. Optional for GRPC requests. (required)
        :param bool exclude_previous_versions: Indicates if previous versions should be excluded. Optional; default false.
        :return: RestrictionsListRestrictionSetDefinitionVersionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_restriction_set_definition_versions2_with_http_info(restriction_set_definition_id, **kwargs)  # noqa: E501
        else:
            (data) = self.list_restriction_set_definition_versions2_with_http_info(restriction_set_definition_id, **kwargs)  # noqa: E501
            return data

    def list_restriction_set_definition_versions2_with_http_info(self, restriction_set_definition_id, **kwargs):  # noqa: E501
        """Lists all the restriction set definition versions sorted by name. This list method does not support pagination, as we believe it will never reach a point where pagination is required, even after many years of use. The restriction set definition versions are sorted by creation time from earliest to latest.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restriction_set_definition_versions2_with_http_info(restriction_set_definition_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str restriction_set_definition_id: The restriction set definition ID that the restriction set definition versions must belong to. If empty, all restriction set definitions are returned. Optional for GRPC requests. (required)
        :param bool exclude_previous_versions: Indicates if previous versions should be excluded. Optional; default false.
        :return: RestrictionsListRestrictionSetDefinitionVersionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'exclude_previous_versions' in params:
            query_params.append(('exclude_previous_versions', params['exclude_previous_versions']))  # 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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-set-definition/{restriction_set_definition_id}/versions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsListRestrictionSetDefinitionVersionsResponse',  # 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 list_restriction_set_definitions(self, page_size, **kwargs):  # noqa: E501
        """Lists all the restriction set definitions.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restriction_set_definitions(page_size, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int page_size: The number of results to be retrieved. Required; non-zero; maximum 500.  Required. Min: 1. Max: 500. (required)
        :param str page_token: The token of the page the results are to be retrieved from. If empty, the first page of results will be returned. Optional.
        :return: RestrictionsListRestrictionSetDefinitionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_restriction_set_definitions_with_http_info(page_size, **kwargs)  # noqa: E501
        else:
            (data) = self.list_restriction_set_definitions_with_http_info(page_size, **kwargs)  # noqa: E501
            return data

    def list_restriction_set_definitions_with_http_info(self, page_size, **kwargs):  # noqa: E501
        """Lists all the restriction set definitions.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restriction_set_definitions_with_http_info(page_size, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int page_size: The number of results to be retrieved. Required; non-zero; maximum 500.  Required. Min: 1. Max: 500. (required)
        :param str page_token: The token of the page the results are to be retrieved from. If empty, the first page of results will be returned. Optional.
        :return: RestrictionsListRestrictionSetDefinitionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'page_size' in params:
            query_params.append(('page_size', params['page_size']))  # noqa: E501
        if 'page_token' in params:
            query_params.append(('page_token', params['page_token']))  # 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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-set-definitions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsListRestrictionSetDefinitionsResponse',  # 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 list_restriction_sets(self, **kwargs):  # noqa: E501
        """Returns all the restriction sets for the provided parameters. This does not require pagination, as we only expect this to return a small number of restriction sets. You must provide at least one ID in the request.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restriction_sets(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime effective_timestamp: The time the restriction sets must be active from. Optional; default is current time.
        :param list[str] customer_ids: The IDs of customers that restriction sets are applied to. Optional; Boolean OR interaction with other fields.
        :param list[str] account_ids: The IDs of accounts that restriction sets are applied to. Optional; Boolean OR interaction with other fields.
        :param list[str] payment_device_ids: The IDs of payment devices that restriction sets are applied to. Optional; Boolean OR interaction with other fields.
        :return: RestrictionsListRestrictionSetsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_restriction_sets_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.list_restriction_sets_with_http_info(**kwargs)  # noqa: E501
            return data

    def list_restriction_sets_with_http_info(self, **kwargs):  # noqa: E501
        """Returns all the restriction sets for the provided parameters. This does not require pagination, as we only expect this to return a small number of restriction sets. You must provide at least one ID in the request.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restriction_sets_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime effective_timestamp: The time the restriction sets must be active from. Optional; default is current time.
        :param list[str] customer_ids: The IDs of customers that restriction sets are applied to. Optional; Boolean OR interaction with other fields.
        :param list[str] account_ids: The IDs of accounts that restriction sets are applied to. Optional; Boolean OR interaction with other fields.
        :param list[str] payment_device_ids: The IDs of payment devices that restriction sets are applied to. Optional; Boolean OR interaction with other fields.
        :return: RestrictionsListRestrictionSetsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['effective_timestamp', 'customer_ids', 'account_ids', 'payment_device_ids']  # 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 list_restriction_sets" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'effective_timestamp' in params:
            query_params.append(('effective_timestamp', params['effective_timestamp']))  # noqa: E501
        if 'customer_ids' in params:
            query_params.append(('customer_ids', params['customer_ids']))  # noqa: E501
            collection_formats['customer_ids'] = 'multi'  # noqa: E501
        if 'account_ids' in params:
            query_params.append(('account_ids', params['account_ids']))  # noqa: E501
            collection_formats['account_ids'] = 'multi'  # noqa: E501
        if 'payment_device_ids' in params:
            query_params.append(('payment_device_ids', params['payment_device_ids']))  # noqa: E501
            collection_formats['payment_device_ids'] = 'multi'  # 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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-sets', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsListRestrictionSetsResponse',  # 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 list_restrictions(self, **kwargs):  # noqa: E501
        """Lists all the restrictions for the provided parameters. This does not require pagination, as we only expect this to return a small number of restrictions. You must provide at least one ID in the request.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restrictions(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime effective_timestamp: The time the restrictions must be active from. Optional; default is current time.
        :param list[str] customer_ids: The IDs of customers that restrictions are applied to. Optional; Boolean OR interaction with other fields.
        :param list[str] account_ids: The IDs of accounts that restrictions are applied to. Optional; Boolean OR interaction with other fields.
        :param list[str] payment_device_ids: The IDs of payment devices that restrictions are applied to. Optional; Boolean OR interaction with other fields.
        :return: RestrictionsListRestrictionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_restrictions_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.list_restrictions_with_http_info(**kwargs)  # noqa: E501
            return data

    def list_restrictions_with_http_info(self, **kwargs):  # noqa: E501
        """Lists all the restrictions for the provided parameters. This does not require pagination, as we only expect this to return a small number of restrictions. You must provide at least one ID in the request.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_restrictions_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime effective_timestamp: The time the restrictions must be active from. Optional; default is current time.
        :param list[str] customer_ids: The IDs of customers that restrictions are applied to. Optional; Boolean OR interaction with other fields.
        :param list[str] account_ids: The IDs of accounts that restrictions are applied to. Optional; Boolean OR interaction with other fields.
        :param list[str] payment_device_ids: The IDs of payment devices that restrictions are applied to. Optional; Boolean OR interaction with other fields.
        :return: RestrictionsListRestrictionsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['effective_timestamp', 'customer_ids', 'account_ids', 'payment_device_ids']  # 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 list_restrictions" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'effective_timestamp' in params:
            query_params.append(('effective_timestamp', params['effective_timestamp']))  # noqa: E501
        if 'customer_ids' in params:
            query_params.append(('customer_ids', params['customer_ids']))  # noqa: E501
            collection_formats['customer_ids'] = 'multi'  # noqa: E501
        if 'account_ids' in params:
            query_params.append(('account_ids', params['account_ids']))  # noqa: E501
            collection_formats['account_ids'] = 'multi'  # noqa: E501
        if 'payment_device_ids' in params:
            query_params.append(('payment_device_ids', params['payment_device_ids']))  # noqa: E501
            collection_formats['payment_device_ids'] = 'multi'  # 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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restrictions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsListRestrictionsResponse',  # 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_restriction_set(self, body, restriction_set_id, **kwargs):  # noqa: E501
        """Updates a restriction set.  # 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_restriction_set(body, restriction_set_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RestrictionsUpdateRestrictionSetRequest body: (required)
        :param str restriction_set_id: The unique identifier for this restriction set. Output only. (required)
        :return: RestrictionsRestrictionSet
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_restriction_set_with_http_info(body, restriction_set_id, **kwargs)  # noqa: E501
        else:
            (data) = self.update_restriction_set_with_http_info(body, restriction_set_id, **kwargs)  # noqa: E501
            return data

    def update_restriction_set_with_http_info(self, body, restriction_set_id, **kwargs):  # noqa: E501
        """Updates a restriction set.  # 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_restriction_set_with_http_info(body, restriction_set_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RestrictionsUpdateRestrictionSetRequest body: (required)
        :param str restriction_set_id: The unique identifier for this restriction set. Output only. (required)
        :return: RestrictionsRestrictionSet
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'restriction_set_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 update_restriction_set" % 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_restriction_set`")  # noqa: E501
        # verify the required parameter 'restriction_set_id' is set
        if ('restriction_set_id' not in params or
                params['restriction_set_id'] is None):
            raise ValueError("Missing the required parameter `restriction_set_id` when calling `update_restriction_set`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'restriction_set_id' in params:
            path_params['restriction_set.id'] = params['restriction_set_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 = ['ApiKeyAuth']  # noqa: E501

        return self.api_client.call_api(
            '/v1/restriction-sets/{restriction_set.id}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RestrictionsRestrictionSet',  # 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)
