# coding: utf-8

"""
    Collibra Data Governance Center Core API

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

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

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from collibra_core.api_client import ApiClient


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

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

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

    def add_assignment(self, **kwargs):  # noqa: E501
        """Adds a new Assignment.  # noqa: E501

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

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

    def add_assignment_with_http_info(self, **kwargs):  # noqa: E501
        """Adds a new Assignment.  # noqa: E501

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

        :param async_req bool
        :param AddAssignmentRequest body:
        :return: AssignmentImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

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

    def change_assignment(self, assignment_id, **kwargs):  # noqa: E501
        """Changes the assignment with the information that is provided in the request.  # noqa: E501

        Changes the assignment with the information that is provided in the request. Only properties that are specified in the request and are not NULL are updated. All other properties are ignored.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_assignment(assignment_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str assignment_id: The unique identifier of the Assignment. (required)
        :param ChangeAssignmentRequest body:
        :return: AssignmentImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.change_assignment_with_http_info(assignment_id, **kwargs)  # noqa: E501
        else:
            (data) = self.change_assignment_with_http_info(assignment_id, **kwargs)  # noqa: E501
            return data

    def change_assignment_with_http_info(self, assignment_id, **kwargs):  # noqa: E501
        """Changes the assignment with the information that is provided in the request.  # noqa: E501

        Changes the assignment with the information that is provided in the request. Only properties that are specified in the request and are not NULL are updated. All other properties are ignored.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_assignment_with_http_info(assignment_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str assignment_id: The unique identifier of the Assignment. (required)
        :param ChangeAssignmentRequest body:
        :return: AssignmentImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

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

    def find_assignments_for_resource(self, **kwargs):  # noqa: E501
        """Find the assignments where a given resource is assigned.  # noqa: E501

        Find the assignments where a given resource is assigned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.find_assignments_for_resource(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str resource_id: The ID of the resource on which the assignment applies.
        :param str resource_type: The type of resource that is assigned.
        :return: list[AssignmentImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.find_assignments_for_resource_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.find_assignments_for_resource_with_http_info(**kwargs)  # noqa: E501
            return data

    def find_assignments_for_resource_with_http_info(self, **kwargs):  # noqa: E501
        """Find the assignments where a given resource is assigned.  # noqa: E501

        Find the assignments where a given resource is assigned.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.find_assignments_for_resource_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str resource_id: The ID of the resource on which the assignment applies.
        :param str resource_type: The type of resource that is assigned.
        :return: list[AssignmentImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'resource_id' in params:
            query_params.append(('resourceId', params['resource_id']))  # noqa: E501
        if 'resource_type' in params:
            query_params.append(('resourceType', params['resource_type']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/assignments/forResource', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[AssignmentImpl]',  # 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_assignments_for_asset(self, asset_id, **kwargs):  # noqa: E501
        """Returns the Assignment identified by the given Asset.  # noqa: E501

        Returns the Assignment identified by the given Asset.  # 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_assignments_for_asset(asset_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_id: The unique identifier of the Asset. (required)
        :return: AssignmentImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_assignments_for_asset_with_http_info(asset_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_assignments_for_asset_with_http_info(asset_id, **kwargs)  # noqa: E501
            return data

    def get_assignments_for_asset_with_http_info(self, asset_id, **kwargs):  # noqa: E501
        """Returns the Assignment identified by the given Asset.  # noqa: E501

        Returns the Assignment identified by the given Asset.  # 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_assignments_for_asset_with_http_info(asset_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_id: The unique identifier of the Asset. (required)
        :return: AssignmentImpl
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/assignments/asset/{assetId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AssignmentImpl',  # 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_assignments_for_asset_type(self, asset_type_id, **kwargs):  # noqa: E501
        """Returns Assignments for given asset type id.  # noqa: E501

        Returns Assignments for given asset type id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_assignments_for_asset_type(asset_type_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_type_id: The unique identifier of the AssetType. (required)
        :return: list[AssignmentImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_assignments_for_asset_type_with_http_info(asset_type_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_assignments_for_asset_type_with_http_info(asset_type_id, **kwargs)  # noqa: E501
            return data

    def get_assignments_for_asset_type_with_http_info(self, asset_type_id, **kwargs):  # noqa: E501
        """Returns Assignments for given asset type id.  # noqa: E501

        Returns Assignments for given asset type id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_assignments_for_asset_type_with_http_info(asset_type_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_type_id: The unique identifier of the AssetType. (required)
        :return: list[AssignmentImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/assignments/assetType/{assetTypeId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[AssignmentImpl]',  # 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_available_asset_types_for_domain(self, domain_id, **kwargs):  # noqa: E501
        """Returns available asset types for domain identified by given id.  # noqa: E501

        Returns available asset types for domain identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_available_asset_types_for_domain(domain_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str domain_id: The unique identifier of the Domain. (required)
        :return: list[AssetTypeImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_available_asset_types_for_domain_with_http_info(domain_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_available_asset_types_for_domain_with_http_info(domain_id, **kwargs)  # noqa: E501
            return data

    def get_available_asset_types_for_domain_with_http_info(self, domain_id, **kwargs):  # noqa: E501
        """Returns available asset types for domain identified by given id.  # noqa: E501

        Returns available asset types for domain identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_available_asset_types_for_domain_with_http_info(domain_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str domain_id: The unique identifier of the Domain. (required)
        :return: list[AssetTypeImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/assignments/domain/{domainId}/assetTypes', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[AssetTypeImpl]',  # 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_available_attribute_types_for_asset(self, asset_id, **kwargs):  # noqa: E501
        """Returns available attribute types for asset identified by given id.  # noqa: E501

        Returns available attribute types for asset identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_available_attribute_types_for_asset(asset_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_id: The unique identifier of the Asset. (required)
        :return: list[AttributeType]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_available_attribute_types_for_asset_with_http_info(asset_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_available_attribute_types_for_asset_with_http_info(asset_id, **kwargs)  # noqa: E501
            return data

    def get_available_attribute_types_for_asset_with_http_info(self, asset_id, **kwargs):  # noqa: E501
        """Returns available attribute types for asset identified by given id.  # noqa: E501

        Returns available attribute types for asset identified by given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_available_attribute_types_for_asset_with_http_info(asset_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_id: The unique identifier of the Asset. (required)
        :return: list[AttributeType]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/assignments/asset/{assetId}/attributeTypes', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[AttributeType]',  # 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_available_complex_relation_types_for_asset(self, asset_id, **kwargs):  # noqa: E501
        """Returns the available ComplexRelationTypes for the Asset identified by the given id.  # noqa: E501

        Returns the available ComplexRelationTypes for the Asset identified by the given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_available_complex_relation_types_for_asset(asset_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_id: The unique identifier of the Asset. (required)
        :return: list[ComplexRelationTypeImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_available_complex_relation_types_for_asset_with_http_info(asset_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_available_complex_relation_types_for_asset_with_http_info(asset_id, **kwargs)  # noqa: E501
            return data

    def get_available_complex_relation_types_for_asset_with_http_info(self, asset_id, **kwargs):  # noqa: E501
        """Returns the available ComplexRelationTypes for the Asset identified by the given id.  # noqa: E501

        Returns the available ComplexRelationTypes for the Asset identified by the given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_available_complex_relation_types_for_asset_with_http_info(asset_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_id: The unique identifier of the Asset. (required)
        :return: list[ComplexRelationTypeImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/assignments/asset/{assetId}/complexRelationTypes', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[ComplexRelationTypeImpl]',  # 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_available_relation_types_for_asset(self, asset_id, **kwargs):  # noqa: E501
        """Returns the available RelationTypes for the Asset identified by the given id.  # noqa: E501

        Returns the available RelationTypes for the Asset identified by the given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_available_relation_types_for_asset(asset_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_id: The unique identifier of the Asset. (required)
        :return: list[RelationTypeImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_available_relation_types_for_asset_with_http_info(asset_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_available_relation_types_for_asset_with_http_info(asset_id, **kwargs)  # noqa: E501
            return data

    def get_available_relation_types_for_asset_with_http_info(self, asset_id, **kwargs):  # noqa: E501
        """Returns the available RelationTypes for the Asset identified by the given id.  # noqa: E501

        Returns the available RelationTypes for the Asset identified by the given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_available_relation_types_for_asset_with_http_info(asset_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str asset_id: The unique identifier of the Asset. (required)
        :return: list[RelationTypeImpl]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/assignments/asset/{assetId}/relationTypes', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[RelationTypeImpl]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def remove_assignment(self, assignment_id, **kwargs):  # noqa: E501
        """Removes the Assignment identified by the given id.  # noqa: E501

        Removes the Assignment identified by the given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.remove_assignment(assignment_id, async_req=True)
        >>> result = thread.get()

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

    def remove_assignment_with_http_info(self, assignment_id, **kwargs):  # noqa: E501
        """Removes the Assignment identified by the given id.  # noqa: E501

        Removes the Assignment identified by the given id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.remove_assignment_with_http_info(assignment_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str assignment_id: The unique identifier of the Assignment. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        return self.api_client.call_api(
            '/assignments/{assignmentId}', '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)
