# coding: utf-8

"""
    Onshape REST API

    The Onshape REST API consumed by all clients.  # noqa: E501

    The version of the OpenAPI document: 1.113
    Contact: api-support@onshape.zendesk.com
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import
import re  # noqa: F401
import sys  # noqa: F401

import six  # noqa: F401
import nulltype  # noqa: F401

from onshape_client.oas.model_utils import (  # noqa: F401
    ModelComposed,
    ModelNormal,
    ModelSimple,
    date,
    datetime,
    file_type,
    int,
    none_type,
    str,
    validate_get_composed_info,
)

try:
    from onshape_client.oas.models import bt_active_sheet_metal_filter2944
except ImportError:
    bt_active_sheet_metal_filter2944 = sys.modules[
        "onshape_client.oas.models.bt_active_sheet_metal_filter2944"
    ]
try:
    from onshape_client.oas.models import bt_allow_edge_point_filter2371
except ImportError:
    bt_allow_edge_point_filter2371 = sys.modules[
        "onshape_client.oas.models.bt_allow_edge_point_filter2371"
    ]
try:
    from onshape_client.oas.models import bt_allow_flattened_geometry_filter2140
except ImportError:
    bt_allow_flattened_geometry_filter2140 = sys.modules[
        "onshape_client.oas.models.bt_allow_flattened_geometry_filter2140"
    ]
try:
    from onshape_client.oas.models import bt_allow_mesh_geometry_filter1026
except ImportError:
    bt_allow_mesh_geometry_filter1026 = sys.modules[
        "onshape_client.oas.models.bt_allow_mesh_geometry_filter1026"
    ]
try:
    from onshape_client.oas.models import bt_and_filter110
except ImportError:
    bt_and_filter110 = sys.modules["onshape_client.oas.models.bt_and_filter110"]
try:
    from onshape_client.oas.models import bt_body_type_filter112
except ImportError:
    bt_body_type_filter112 = sys.modules[
        "onshape_client.oas.models.bt_body_type_filter112"
    ]
try:
    from onshape_client.oas.models import bt_closed_curve_filter1206
except ImportError:
    bt_closed_curve_filter1206 = sys.modules[
        "onshape_client.oas.models.bt_closed_curve_filter1206"
    ]
try:
    from onshape_client.oas.models import bt_construction_object_filter113
except ImportError:
    bt_construction_object_filter113 = sys.modules[
        "onshape_client.oas.models.bt_construction_object_filter113"
    ]
try:
    from onshape_client.oas.models import bt_edge_topology_filter122
except ImportError:
    bt_edge_topology_filter122 = sys.modules[
        "onshape_client.oas.models.bt_edge_topology_filter122"
    ]
try:
    from onshape_client.oas.models import bt_entity_type_filter124
except ImportError:
    bt_entity_type_filter124 = sys.modules[
        "onshape_client.oas.models.bt_entity_type_filter124"
    ]
try:
    from onshape_client.oas.models import bt_feature_filter127
except ImportError:
    bt_feature_filter127 = sys.modules["onshape_client.oas.models.bt_feature_filter127"]
try:
    from onshape_client.oas.models import bt_feature_type_filter962
except ImportError:
    bt_feature_type_filter962 = sys.modules[
        "onshape_client.oas.models.bt_feature_type_filter962"
    ]
try:
    from onshape_client.oas.models import bt_flat_sheet_metal_filter3018
except ImportError:
    bt_flat_sheet_metal_filter3018 = sys.modules[
        "onshape_client.oas.models.bt_flat_sheet_metal_filter3018"
    ]
try:
    from onshape_client.oas.models import bt_geometry_filter130
except ImportError:
    bt_geometry_filter130 = sys.modules[
        "onshape_client.oas.models.bt_geometry_filter130"
    ]
try:
    from onshape_client.oas.models import bt_image_filter853
except ImportError:
    bt_image_filter853 = sys.modules["onshape_client.oas.models.bt_image_filter853"]
try:
    from onshape_client.oas.models import bt_mate_connector_filter163
except ImportError:
    bt_mate_connector_filter163 = sys.modules[
        "onshape_client.oas.models.bt_mate_connector_filter163"
    ]
try:
    from onshape_client.oas.models import bt_mate_filter162
except ImportError:
    bt_mate_filter162 = sys.modules["onshape_client.oas.models.bt_mate_filter162"]
try:
    from onshape_client.oas.models import bt_modifiable_entity_only_filter1593
except ImportError:
    bt_modifiable_entity_only_filter1593 = sys.modules[
        "onshape_client.oas.models.bt_modifiable_entity_only_filter1593"
    ]
try:
    from onshape_client.oas.models import bt_not_filter165
except ImportError:
    bt_not_filter165 = sys.modules["onshape_client.oas.models.bt_not_filter165"]
try:
    from onshape_client.oas.models import bt_occurrence_filter166
except ImportError:
    bt_occurrence_filter166 = sys.modules[
        "onshape_client.oas.models.bt_occurrence_filter166"
    ]
try:
    from onshape_client.oas.models import bt_or_filter167
except ImportError:
    bt_or_filter167 = sys.modules["onshape_client.oas.models.bt_or_filter167"]
try:
    from onshape_client.oas.models import bt_plane_orientation_filter1700
except ImportError:
    bt_plane_orientation_filter1700 = sys.modules[
        "onshape_client.oas.models.bt_plane_orientation_filter1700"
    ]
try:
    from onshape_client.oas.models import bt_sketch_object_filter184
except ImportError:
    bt_sketch_object_filter184 = sys.modules[
        "onshape_client.oas.models.bt_sketch_object_filter184"
    ]
try:
    from onshape_client.oas.models import bt_text_object_filter1515
except ImportError:
    bt_text_object_filter1515 = sys.modules[
        "onshape_client.oas.models.bt_text_object_filter1515"
    ]
try:
    from onshape_client.oas.models import bt_text_stroke_filter461
except ImportError:
    bt_text_stroke_filter461 = sys.modules[
        "onshape_client.oas.models.bt_text_stroke_filter461"
    ]
try:
    from onshape_client.oas.models import btsm_definition_entity_type_filter1651
except ImportError:
    btsm_definition_entity_type_filter1651 = sys.modules[
        "onshape_client.oas.models.btsm_definition_entity_type_filter1651"
    ]


class BTQueryFilter183(ModelNormal):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.

    Attributes:
      allowed_values (dict): The key is the tuple path to the attribute
          and the for var_name this is (var_name,). The value is a dict
          with a capitalized key describing the allowed value and an allowed
          value. These dicts store the allowed enum values.
      attribute_map (dict): The key is attribute name
          and the value is json key in definition.
      discriminator_value_class_map (dict): A dict to go from the discriminator
          variable value to the discriminator class name.
      validations (dict): The key is the tuple path to the attribute
          and the for var_name this is (var_name,). The value is a dict
          that stores validations for max_length, min_length, max_items,
          min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
          inclusive_minimum, and regex.
      additional_properties_type (tuple): A tuple of classes accepted
          as additional properties values.
    """

    allowed_values = {}

    validations = {}

    additional_properties_type = None

    @staticmethod
    def openapi_types():
        """
        This must be a class method so a model may have properties that are
        of type self, this ensures that we don't create a cyclic import

        Returns
            openapi_types (dict): The key is attribute name
                and the value is attribute type.
        """
        return {
            "bt_type": (str,),  # noqa: E501
        }

    @staticmethod
    def discriminator():
        return {
            "bt_type": {
                "BTTextStrokeFilter-461": bt_text_stroke_filter461.BTTextStrokeFilter461,
                "BTConstructionObjectFilter-113": bt_construction_object_filter113.BTConstructionObjectFilter113,
                "BTTextObjectFilter-1515": bt_text_object_filter1515.BTTextObjectFilter1515,
                "BTImageFilter-853": bt_image_filter853.BTImageFilter853,
                "BTAndFilter-110": bt_and_filter110.BTAndFilter110,
                "BTMateFilter-162": bt_mate_filter162.BTMateFilter162,
                "BTEdgeTopologyFilter-122": bt_edge_topology_filter122.BTEdgeTopologyFilter122,
                "BTSketchObjectFilter-184": bt_sketch_object_filter184.BTSketchObjectFilter184,
                "BTAllowMeshGeometryFilter-1026": bt_allow_mesh_geometry_filter1026.BTAllowMeshGeometryFilter1026,
                "BTOrFilter-167": bt_or_filter167.BTOrFilter167,
                "BTClosedCurveFilter-1206": bt_closed_curve_filter1206.BTClosedCurveFilter1206,
                "BTAllowFlattenedGeometryFilter-2140": bt_allow_flattened_geometry_filter2140.BTAllowFlattenedGeometryFilter2140,
                "BTGeometryFilter-130": bt_geometry_filter130.BTGeometryFilter130,
                "BTNotFilter-165": bt_not_filter165.BTNotFilter165,
                "BTPlaneOrientationFilter-1700": bt_plane_orientation_filter1700.BTPlaneOrientationFilter1700,
                "BTAllowEdgePointFilter-2371": bt_allow_edge_point_filter2371.BTAllowEdgePointFilter2371,
                "BTBodyTypeFilter-112": bt_body_type_filter112.BTBodyTypeFilter112,
                "BTFeatureFilter-127": bt_feature_filter127.BTFeatureFilter127,
                "BTSMDefinitionEntityTypeFilter-1651": btsm_definition_entity_type_filter1651.BTSMDefinitionEntityTypeFilter1651,
                "BTOccurrenceFilter-166": bt_occurrence_filter166.BTOccurrenceFilter166,
                "BTEntityTypeFilter-124": bt_entity_type_filter124.BTEntityTypeFilter124,
                "BTMateConnectorFilter-163": bt_mate_connector_filter163.BTMateConnectorFilter163,
                "BTFeatureTypeFilter-962": bt_feature_type_filter962.BTFeatureTypeFilter962,
                "BTFlatSheetMetalFilter-3018": bt_flat_sheet_metal_filter3018.BTFlatSheetMetalFilter3018,
                "BTActiveSheetMetalFilter-2944": bt_active_sheet_metal_filter2944.BTActiveSheetMetalFilter2944,
                "BTModifiableEntityOnlyFilter-1593": bt_modifiable_entity_only_filter1593.BTModifiableEntityOnlyFilter1593,
            },
        }

    attribute_map = {
        "bt_type": "btType",  # noqa: E501
    }

    @staticmethod
    def _composed_schemas():
        return None

    required_properties = set(
        [
            "_data_store",
            "_check_type",
            "_from_server",
            "_path_to_item",
            "_configuration",
        ]
    )

    def __init__(
        self,
        _check_type=True,
        _from_server=False,
        _path_to_item=(),
        _configuration=None,
        **kwargs
    ):  # noqa: E501
        """bt_query_filter183.BTQueryFilter183 - a model defined in OpenAPI

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _from_server (bool): True if the data is from the server
                                False if the data is from the client (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            bt_type (str): [optional]  # noqa: E501
        """

        self._data_store = {}
        self._check_type = _check_type
        self._from_server = _from_server
        self._path_to_item = _path_to_item
        self._configuration = _configuration

        for var_name, var_value in six.iteritems(kwargs):
            if (
                var_name not in self.attribute_map
                and self._configuration is not None
                and self._configuration.discard_unknown_keys
                and self.additional_properties_type is None
            ):
                # discard variable.
                continue
            setattr(self, var_name, var_value)

    @classmethod
    def get_discriminator_class(cls, from_server, data):
        """Returns the child class specified by the discriminator"""
        discriminator = cls.discriminator()
        discr_propertyname_py = list(discriminator.keys())[0]
        discr_propertyname_js = cls.attribute_map[discr_propertyname_py]
        if from_server:
            class_name = data[discr_propertyname_js]
        else:
            class_name = data[discr_propertyname_py]
        class_name_to_discr_class = discriminator[discr_propertyname_py]
        return class_name_to_discr_class.get(class_name)
