# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class IndexField(Model):
    """Contains the definition for the index field. A field represents a single
    unit of data.

    :param name: Index field name.
    :type name: str
    :param type: Possible values include: 'Unknown', 'String', 'Boolean',
     'Number', 'ProductId', 'DupId', 'StaticRank', 'Url', 'ImageUrl', 'Title',
     'Description', 'Category', 'Price', 'Rating', 'Brand', 'Model', 'Color',
     'Size', 'Material', 'Gender', 'AgeGroup', 'Array', 'Dictionary',
     'ExcludeFlag', 'Identifier', 'Object', 'DocumentId', 'Author',
     'CreatedAt', 'ModifiedAt', 'Paragraph', 'SubHeading', 'SectionHeader',
     'Address', 'RatingCount', 'ReviewCount', 'RatingScale', 'Amenities',
     'StreetAddress', 'Locality', 'SubRegion', 'AddressRegion', 'PostalCode',
     'PostOfficeBoxNumber', 'Country', 'CountryIso', 'Neighborhood',
     'OtherAreas', 'PhoneNumber', 'Barcode', 'SecondaryImageUrls'
    :type type: str or
     ~microsoft.bing.commerce.ingestion.models.IndexFieldType
    :param facetable: Enables using the field for facets and other field-based
     aggregations.
    :type facetable: bool
    :param filterable: Enables using the field in filter and boost conditions.
    :type filterable: bool
    :param retrievable: Enables using the field values in search response.
    :type retrievable: bool
    :param searchable: Enables text matching on the field.
    :type searchable: bool
    :param sortable: Enables sorting results by the field.
    :type sortable: bool
    :param field_label: A label to use with the field.
    :type field_label: str
    :param fields: A child list of fields.
    :type fields: list[~microsoft.bing.commerce.ingestion.models.IndexField]
    """

    _attribute_map = {
        'name': {'key': 'name', 'type': 'str'},
        'type': {'key': 'type', 'type': 'IndexFieldType'},
        'facetable': {'key': 'facetable', 'type': 'bool'},
        'filterable': {'key': 'filterable', 'type': 'bool'},
        'retrievable': {'key': 'retrievable', 'type': 'bool'},
        'searchable': {'key': 'searchable', 'type': 'bool'},
        'sortable': {'key': 'sortable', 'type': 'bool'},
        'field_label': {'key': 'fieldLabel', 'type': 'str'},
        'fields': {'key': 'fields', 'type': '[IndexField]'},
    }

    def __init__(self, **kwargs):
        super(IndexField, self).__init__(**kwargs)
        self.name = kwargs.get('name', None)
        self.type = kwargs.get('type', None)
        self.facetable = kwargs.get('facetable', None)
        self.filterable = kwargs.get('filterable', None)
        self.retrievable = kwargs.get('retrievable', None)
        self.searchable = kwargs.get('searchable', None)
        self.sortable = kwargs.get('sortable', None)
        self.field_label = kwargs.get('field_label', None)
        self.fields = kwargs.get('fields', None)
