# coding: utf-8

"""
    UUDEXApi

    uudex api  # noqa: E501

    OpenAPI spec version: 1.0
    Contact: jeff.welsh@pnnl.gov
    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 uudex_client.api_client import ApiClient


class SubjectPolicyApi(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 create_acl_constraint(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Create a ACL Constraint for a given Subject Policy  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # 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_acl_constraint(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

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

    def create_acl_constraint_with_http_info(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Create a ACL Constraint for a given Subject Policy  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # 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_acl_constraint_with_http_info(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subject_policy_uuid: (required)
        :param SubjectPolicyAclConstraint body:
        :return: SubjectPolicyAclConstraint
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'subject_policy_uuid' in params:
            path_params['subject_policy_uuid'] = params['subject_policy_uuid']  # 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(
            '/subject-policies/{subject_policy_uuid}/acl-constraints', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubjectPolicyAclConstraint',  # 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_subject_policy(self, **kwargs):  # noqa: E501
        """Creates a Subject Policy and attaches it to given Participant  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # 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_subject_policy(async_req=True)
        >>> result = thread.get()

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

    def create_subject_policy_with_http_info(self, **kwargs):  # noqa: E501
        """Creates a Subject Policy and attaches it to given Participant  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # 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_subject_policy_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SubjectPolicy body:
        :return: SubjectPolicy
                 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_subject_policy" % 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(
            '/subject-policies', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubjectPolicy',  # 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 delete_acl_constraint(self, subject_policy_uuid, acl_constraint_id, **kwargs):  # noqa: E501
        """Delete a single ACL Constraint for a given Subject Policy  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_acl_constraint(subject_policy_uuid, acl_constraint_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subject_policy_uuid: (required)
        :param int acl_constraint_id: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_acl_constraint_with_http_info(subject_policy_uuid, acl_constraint_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_acl_constraint_with_http_info(subject_policy_uuid, acl_constraint_id, **kwargs)  # noqa: E501
            return data

    def delete_acl_constraint_with_http_info(self, subject_policy_uuid, acl_constraint_id, **kwargs):  # noqa: E501
        """Delete a single ACL Constraint for a given Subject Policy  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_acl_constraint_with_http_info(subject_policy_uuid, acl_constraint_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subject_policy_uuid: (required)
        :param int acl_constraint_id: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'subject_policy_uuid' in params:
            path_params['subject_policy_uuid'] = params['subject_policy_uuid']  # noqa: E501
        if 'acl_constraint_id' in params:
            path_params['acl_constraint_id'] = params['acl_constraint_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(
            '/subject-policies/{subject_policy_uuid}/acl-constraints/{acl_constraint_id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def delete_subject_policy(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Delete a single Subject Policy  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_subject_policy(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

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

    def delete_subject_policy_with_http_info(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Delete a single Subject Policy  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_subject_policy_with_http_info(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subject_policy_uuid: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'subject_policy_uuid' in params:
            path_params['subject_policy_uuid'] = params['subject_policy_uuid']  # 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(
            '/subject-policies/{subject_policy_uuid}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_acl_constraint(self, subject_policy_uuid, acl_constraint_id, **kwargs):  # noqa: E501
        """Return a single ACL Constraint for a given Subject Policy  # noqa: E501

        Returns the ACL Constraint for the given Subject Policy that the invoker's Participant is attached to.  A UUDEX Admin may get any given Subject Policy constraint.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_acl_constraint(subject_policy_uuid, acl_constraint_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subject_policy_uuid: (required)
        :param int acl_constraint_id: (required)
        :return: SubjectPolicyAclConstraint
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_acl_constraint_with_http_info(subject_policy_uuid, acl_constraint_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_acl_constraint_with_http_info(subject_policy_uuid, acl_constraint_id, **kwargs)  # noqa: E501
            return data

    def get_acl_constraint_with_http_info(self, subject_policy_uuid, acl_constraint_id, **kwargs):  # noqa: E501
        """Return a single ACL Constraint for a given Subject Policy  # noqa: E501

        Returns the ACL Constraint for the given Subject Policy that the invoker's Participant is attached to.  A UUDEX Admin may get any given Subject Policy constraint.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_acl_constraint_with_http_info(subject_policy_uuid, acl_constraint_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subject_policy_uuid: (required)
        :param int acl_constraint_id: (required)
        :return: SubjectPolicyAclConstraint
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['subject_policy_uuid', 'acl_constraint_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'subject_policy_uuid' in params:
            path_params['subject_policy_uuid'] = params['subject_policy_uuid']  # noqa: E501
        if 'acl_constraint_id' in params:
            path_params['acl_constraint_id'] = params['acl_constraint_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(
            '/subject-policies/{subject_policy_uuid}/acl-constraints/{acl_constraint_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubjectPolicyAclConstraint',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_all_acl_constraints(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Return all ACL Constraints for a given Subject Policy  # noqa: E501

        Returns a collection of ACL Constraints for the given Subject Policy the invoker's Participant is attached to.  A UUDEX Admin may get a collection of ACL Constraints for any given Subject Policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_all_acl_constraints(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

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

    def get_all_acl_constraints_with_http_info(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Return all ACL Constraints for a given Subject Policy  # noqa: E501

        Returns a collection of ACL Constraints for the given Subject Policy the invoker's Participant is attached to.  A UUDEX Admin may get a collection of ACL Constraints for any given Subject Policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_all_acl_constraints_with_http_info(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subject_policy_uuid: (required)
        :return: list[SubjectPolicyAclConstraint]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['subject_policy_uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'subject_policy_uuid' in params:
            path_params['subject_policy_uuid'] = params['subject_policy_uuid']  # 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(
            '/subject-policies/{subject_policy_uuid}/acl-constraints', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[SubjectPolicyAclConstraint]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_subject_policies(self, **kwargs):  # noqa: E501
        """Returns a collection of Subject Policies  # noqa: E501

        Returns a collection of all Subject Policies the invoker's Participant is attached to.  A UUDEX Admin will get all Subject Policies in the system.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_subject_policies(async_req=True)
        >>> result = thread.get()

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

    def get_subject_policies_with_http_info(self, **kwargs):  # noqa: E501
        """Returns a collection of Subject Policies  # noqa: E501

        Returns a collection of all Subject Policies the invoker's Participant is attached to.  A UUDEX Admin will get all Subject Policies in the system.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_subject_policies_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[SubjectPolicyEnriched]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_subject_policies" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        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(
            '/subject-policies', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[SubjectPolicyEnriched]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_subject_policy(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Return a single Subject Policy  # noqa: E501

        Returns a single Subject Policy that invoker's Participant is attached to.  A UUDEX Admin may get any subject Policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_subject_policy(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

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

    def get_subject_policy_with_http_info(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Return a single Subject Policy  # noqa: E501

        Returns a single Subject Policy that invoker's Participant is attached to.  A UUDEX Admin may get any subject Policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_subject_policy_with_http_info(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subject_policy_uuid: (required)
        :return: SubjectPolicyEnriched
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['subject_policy_uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'subject_policy_uuid' in params:
            path_params['subject_policy_uuid'] = params['subject_policy_uuid']  # 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(
            '/subject-policies/{subject_policy_uuid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubjectPolicyEnriched',  # 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_subject_policy(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Update a single Subject Policy  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # 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_subject_policy(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

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

    def update_subject_policy_with_http_info(self, subject_policy_uuid, **kwargs):  # noqa: E501
        """Update a single Subject Policy  # noqa: E501

        The invoker must be a UUDEX Admin otherwise the call will fail.  # 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_subject_policy_with_http_info(subject_policy_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str subject_policy_uuid: (required)
        :param SubjectPolicy body:
        :return: SubjectPolicy
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'subject_policy_uuid' in params:
            path_params['subject_policy_uuid'] = params['subject_policy_uuid']  # 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(
            '/subject-policies/{subject_policy_uuid}', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubjectPolicy',  # 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)
