# coding: utf-8

"""
    Collibra Search API

    <p>The Search API allows you to create your own integration with the Collibra Search Engine.<br /> Find your data!</p>  # noqa: E501

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

from datetime import date, datetime  # noqa: F401
import decimal  # noqa: F401
import functools  # noqa: F401
import io  # noqa: F401
import re  # noqa: F401
import typing  # noqa: F401
import typing_extensions  # noqa: F401
import uuid  # noqa: F401

import frozendict  # noqa: F401

from collibra_search import schemas  # noqa: F401


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

    Do not edit the class manually.

    The search criteria.
    """


    class MetaOapg:
        
        class properties:
            
            
            class keywords(
                schemas.StrSchema
            ):
            
            
                class MetaOapg:
                    max_length = 1000
                    min_length = 1
            
            
            class searchInFields(
                schemas.ListBase,
                schemas.NoneBase,
                schemas.Schema,
                schemas.NoneTupleMixin
            ):
            
            
                class MetaOapg:
                    
                    @staticmethod
                    def items() -> typing.Type['SearchInFields']:
                        return SearchInFields
                    unique_items = True
            
            
                def __new__(
                    cls,
                    *args: typing.Union[list, tuple, None, ],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'searchInFields':
                    return super().__new__(
                        cls,
                        *args,
                        _configuration=_configuration,
                    )
            
            
            class filters(
                schemas.ListBase,
                schemas.NoneBase,
                schemas.Schema,
                schemas.NoneTupleMixin
            ):
            
            
                class MetaOapg:
                    
                    @staticmethod
                    def items() -> typing.Type['SearchFilter']:
                        return SearchFilter
                    unique_items = True
            
            
                def __new__(
                    cls,
                    *args: typing.Union[list, tuple, None, ],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'filters':
                    return super().__new__(
                        cls,
                        *args,
                        _configuration=_configuration,
                    )
            
            
            class aggregations(
                schemas.ListBase,
                schemas.NoneBase,
                schemas.Schema,
                schemas.NoneTupleMixin
            ):
            
            
                class MetaOapg:
                    
                    @staticmethod
                    def items() -> typing.Type['SearchAggregation']:
                        return SearchAggregation
                    unique_items = True
            
            
                def __new__(
                    cls,
                    *args: typing.Union[list, tuple, None, ],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'aggregations':
                    return super().__new__(
                        cls,
                        *args,
                        _configuration=_configuration,
                    )
            
            
            class sortField(
                schemas.EnumBase,
                schemas.StrBase,
                schemas.NoneBase,
                schemas.Schema,
                schemas.NoneStrMixin
            ):
            
            
                class MetaOapg:
                    enum_value_to_name = {
                        "RELEVANCE": "RELEVANCE",
                        "NAME": "NAME",
                        "LAST_MODIFIED_ON": "LAST_MODIFIED_ON",
                    }
                
                @schemas.classproperty
                def RELEVANCE(cls):
                    return cls("RELEVANCE")
                
                @schemas.classproperty
                def NAME(cls):
                    return cls("NAME")
                
                @schemas.classproperty
                def LAST_MODIFIED_ON(cls):
                    return cls("LAST_MODIFIED_ON")
            
            
                def __new__(
                    cls,
                    *args: typing.Union[None, str, ],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'sortField':
                    return super().__new__(
                        cls,
                        *args,
                        _configuration=_configuration,
                    )
            
            
            class sortOrder(
                schemas.EnumBase,
                schemas.StrBase,
                schemas.NoneBase,
                schemas.Schema,
                schemas.NoneStrMixin
            ):
            
            
                class MetaOapg:
                    enum_value_to_name = {
                        "ASC": "ASC",
                        "DESC": "DESC",
                    }
                
                @schemas.classproperty
                def ASC(cls):
                    return cls("ASC")
                
                @schemas.classproperty
                def DESC(cls):
                    return cls("DESC")
            
            
                def __new__(
                    cls,
                    *args: typing.Union[None, str, ],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'sortOrder':
                    return super().__new__(
                        cls,
                        *args,
                        _configuration=_configuration,
                    )
        
            @staticmethod
            def highlights() -> typing.Type['SearchHighlight']:
                return SearchHighlight
            
            
            class limit(
                schemas.Int32Base,
                schemas.IntBase,
                schemas.NoneBase,
                schemas.Schema,
                schemas.NoneDecimalMixin
            ):
            
            
                class MetaOapg:
                    format = 'int32'
                    inclusive_maximum = 1000
                    inclusive_minimum = 0
            
            
                def __new__(
                    cls,
                    *args: typing.Union[None, decimal.Decimal, int, ],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'limit':
                    return super().__new__(
                        cls,
                        *args,
                        _configuration=_configuration,
                    )
            
            
            class offset(
                schemas.Int32Base,
                schemas.IntBase,
                schemas.NoneBase,
                schemas.Schema,
                schemas.NoneDecimalMixin
            ):
            
            
                class MetaOapg:
                    format = 'int32'
                    inclusive_maximum = 10000
                    inclusive_minimum = 0
            
            
                def __new__(
                    cls,
                    *args: typing.Union[None, decimal.Decimal, int, ],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'offset':
                    return super().__new__(
                        cls,
                        *args,
                        _configuration=_configuration,
                    )
            __annotations__ = {
                "keywords": keywords,
                "searchInFields": searchInFields,
                "filters": filters,
                "aggregations": aggregations,
                "sortField": sortField,
                "sortOrder": sortOrder,
                "highlights": highlights,
                "limit": limit,
                "offset": offset,
            }
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["keywords"]) -> MetaOapg.properties.keywords: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["searchInFields"]) -> MetaOapg.properties.searchInFields: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["filters"]) -> MetaOapg.properties.filters: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["aggregations"]) -> MetaOapg.properties.aggregations: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["sortField"]) -> MetaOapg.properties.sortField: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["sortOrder"]) -> MetaOapg.properties.sortOrder: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["highlights"]) -> 'SearchHighlight': ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["limit"]) -> MetaOapg.properties.limit: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["offset"]) -> MetaOapg.properties.offset: ...
    
    @typing.overload
    def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
    
    def __getitem__(self, name: typing.Union[typing_extensions.Literal["keywords", "searchInFields", "filters", "aggregations", "sortField", "sortOrder", "highlights", "limit", "offset", ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)
    
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["keywords"]) -> typing.Union[MetaOapg.properties.keywords, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["searchInFields"]) -> typing.Union[MetaOapg.properties.searchInFields, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["filters"]) -> typing.Union[MetaOapg.properties.filters, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["aggregations"]) -> typing.Union[MetaOapg.properties.aggregations, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["sortField"]) -> typing.Union[MetaOapg.properties.sortField, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["sortOrder"]) -> typing.Union[MetaOapg.properties.sortOrder, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["highlights"]) -> typing.Union['SearchHighlight', schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["limit"]) -> typing.Union[MetaOapg.properties.limit, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["offset"]) -> typing.Union[MetaOapg.properties.offset, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
    
    def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["keywords", "searchInFields", "filters", "aggregations", "sortField", "sortOrder", "highlights", "limit", "offset", ], str]):
        return super().get_item_oapg(name)
    

    def __new__(
        cls,
        *args: typing.Union[dict, frozendict.frozendict, ],
        keywords: typing.Union[MetaOapg.properties.keywords, str, schemas.Unset] = schemas.unset,
        searchInFields: typing.Union[MetaOapg.properties.searchInFields, list, tuple, None, schemas.Unset] = schemas.unset,
        filters: typing.Union[MetaOapg.properties.filters, list, tuple, None, schemas.Unset] = schemas.unset,
        aggregations: typing.Union[MetaOapg.properties.aggregations, list, tuple, None, schemas.Unset] = schemas.unset,
        sortField: typing.Union[MetaOapg.properties.sortField, None, str, schemas.Unset] = schemas.unset,
        sortOrder: typing.Union[MetaOapg.properties.sortOrder, None, str, schemas.Unset] = schemas.unset,
        highlights: typing.Union['SearchHighlight', schemas.Unset] = schemas.unset,
        limit: typing.Union[MetaOapg.properties.limit, None, decimal.Decimal, int, schemas.Unset] = schemas.unset,
        offset: typing.Union[MetaOapg.properties.offset, None, decimal.Decimal, int, schemas.Unset] = schemas.unset,
        _configuration: typing.Optional[schemas.Configuration] = None,
        **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes],
    ) -> 'SearchRequest':
        return super().__new__(
            cls,
            *args,
            keywords=keywords,
            searchInFields=searchInFields,
            filters=filters,
            aggregations=aggregations,
            sortField=sortField,
            sortOrder=sortOrder,
            highlights=highlights,
            limit=limit,
            offset=offset,
            _configuration=_configuration,
            **kwargs,
        )

from collibra_search.model.search_aggregation import SearchAggregation
from collibra_search.model.search_filter import SearchFilter
from collibra_search.model.search_highlight import SearchHighlight
from collibra_search.model.search_in_fields import SearchInFields
