# coding: utf-8

"""
    IncQuery Server Web API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 0.19.0
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import unittest
import datetime

import iqs_client
from iqs_client.models.persist_index_data import PersistIndexData  # noqa: E501
from iqs_client.rest import ApiException

class TestPersistIndexData(unittest.TestCase):
    """PersistIndexData unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def make_instance(self, include_optional):
        """Test PersistIndexData
            include_option is a boolean, when False only required
            params are included, when True both required and
            optional params are included """
        # model = iqs_client.models.persist_index_data.PersistIndexData()  # noqa: E501
        if include_optional :
            return PersistIndexData(
                compartment_uri = 'mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f', 
                write_handle = 'ad86a11a-f353-420b-8a7f-be07e4eb31f3', 
                index_data = iqs_client.models.index_update_data.IndexUpdateData(
                    common_compartment_uri = 'mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f', 
                    element_store = [
                        iqs_client.models.element_store_entry.ElementStoreEntry(
                            classifier = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                classifier_name = '0', 
                                package_ns_uri = '0', ), 
                            elements = [
                                {"compartmentURI":"mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f","relativeElementID":"_10_0EAPbeta2_8740266_1126081779875_694366_861"}
                                ], )
                        ], 
                    attribute_store = [
                        iqs_client.models.attribute_store_entry.AttributeStoreEntry(
                            attribute = iqs_client.models.e_attribute_descriptor.EAttributeDescriptor(
                                name = '0', 
                                owner_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                    classifier_name = '0', 
                                    package_ns_uri = '0', ), 
                                type_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                    classifier_name = '0', 
                                    package_ns_uri = '0', ), ), 
                            tuples = [
                                iqs_client.models.attribute_slot.AttributeSlot(
                                    source = {"compartmentURI":"mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f","relativeElementID":"_10_0EAPbeta2_8740266_1126081779875_694366_861"}, 
                                    values = [
                                        '0'
                                        ], )
                                ], )
                        ], 
                    reference_store = [
                        iqs_client.models.reference_store_entry.ReferenceStoreEntry(
                            reference = iqs_client.models.e_reference_descriptor.EReferenceDescriptor(
                                name = '0', 
                                owner_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                    classifier_name = '0', 
                                    package_ns_uri = '0', ), 
                                type_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                    classifier_name = '0', 
                                    package_ns_uri = '0', ), 
                                opposite_proxy = iqs_client.models.feature_descriptor_proxy.FeatureDescriptorProxy(
                                    feature_name = '0', 
                                    feature_kind = 'EATTRIBUTE', 
                                    classifier_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                        classifier_name = '0', 
                                        package_ns_uri = '0', ), ), ), 
                            tuples = [
                                iqs_client.models.reference_slot.ReferenceSlot(
                                    source = {"compartmentURI":"mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f","relativeElementID":"_10_0EAPbeta2_8740266_1126081779875_694366_861"}, 
                                    targets = [
                                        {"compartmentURI":"mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f","relativeElementID":"_10_0EAPbeta2_8740266_1126081779875_694366_861"}
                                        ], )
                                ], )
                        ], 
                    single_compartment = False, ), 
                all_updates_from_primary_model = False
            )
        else :
            return PersistIndexData(
                compartment_uri = 'mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f',
                write_handle = 'ad86a11a-f353-420b-8a7f-be07e4eb31f3',
                index_data = iqs_client.models.index_update_data.IndexUpdateData(
                    common_compartment_uri = 'mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f', 
                    element_store = [
                        iqs_client.models.element_store_entry.ElementStoreEntry(
                            classifier = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                classifier_name = '0', 
                                package_ns_uri = '0', ), 
                            elements = [
                                {"compartmentURI":"mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f","relativeElementID":"_10_0EAPbeta2_8740266_1126081779875_694366_861"}
                                ], )
                        ], 
                    attribute_store = [
                        iqs_client.models.attribute_store_entry.AttributeStoreEntry(
                            attribute = iqs_client.models.e_attribute_descriptor.EAttributeDescriptor(
                                name = '0', 
                                owner_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                    classifier_name = '0', 
                                    package_ns_uri = '0', ), 
                                type_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                    classifier_name = '0', 
                                    package_ns_uri = '0', ), ), 
                            tuples = [
                                iqs_client.models.attribute_slot.AttributeSlot(
                                    source = {"compartmentURI":"mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f","relativeElementID":"_10_0EAPbeta2_8740266_1126081779875_694366_861"}, 
                                    values = [
                                        '0'
                                        ], )
                                ], )
                        ], 
                    reference_store = [
                        iqs_client.models.reference_store_entry.ReferenceStoreEntry(
                            reference = iqs_client.models.e_reference_descriptor.EReferenceDescriptor(
                                name = '0', 
                                owner_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                    classifier_name = '0', 
                                    package_ns_uri = '0', ), 
                                type_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                    classifier_name = '0', 
                                    package_ns_uri = '0', ), 
                                opposite_proxy = iqs_client.models.feature_descriptor_proxy.FeatureDescriptorProxy(
                                    feature_name = '0', 
                                    feature_kind = 'EATTRIBUTE', 
                                    classifier_proxy = iqs_client.models.e_classifier_descriptor.EClassifierDescriptor(
                                        classifier_name = '0', 
                                        package_ns_uri = '0', ), ), ), 
                            tuples = [
                                iqs_client.models.reference_slot.ReferenceSlot(
                                    source = {"compartmentURI":"mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f","relativeElementID":"_10_0EAPbeta2_8740266_1126081779875_694366_861"}, 
                                    targets = [
                                        {"compartmentURI":"mms-index:/orgs/iql/projects/PROJECT-d0c236d9-186a-485c-9c67-9e6693d1f0d8/refs/master/commits/bc1d4c28-f777-4f58-9df3-b856f39d928f","relativeElementID":"_10_0EAPbeta2_8740266_1126081779875_694366_861"}
                                        ], )
                                ], )
                        ], 
                    single_compartment = False, ),
        )

    def testPersistIndexData(self):
        """Test PersistIndexData"""
        inst_req_only = self.make_instance(include_optional=False)
        inst_req_and_optional = self.make_instance(include_optional=True)


if __name__ == '__main__':
    unittest.main()
