# 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 SegmentMetadata(Model):
    """Represents a base Segment Metadata.

    :param kind: Possible values include: 'default', 'engagement'
    :type kind: str or ~dynamics.customerinsights.api.models.enum
    :param name: Gets the unique name of the segment
    :type name: str
    :param friendly_name: Gets the friendlyName of the segment.
    :type friendly_name: str
    :param description: Gets the description of the segment.
    :type description: str
    :param segment_query_expression:
    :type segment_query_expression:
     ~dynamics.customerinsights.api.models.SegmentationQuery
    :param state: Possible values include: 'inactive', 'active', 'validating',
     'validated', 'invalid', 'validationError'
    :type state: str or ~dynamics.customerinsights.api.models.enum
    :param error_description: Gets the error description when the segment
     metadata has some issues after refresh.
    :type error_description: str
    :param end_date: Gets the end date of the segment.
    :type end_date: datetime
    :param evaluation_status:
    :type evaluation_status:
     ~dynamics.customerinsights.api.models.SegmentationPublishStats
    :param sql_validation_stats:
    :type sql_validation_stats:
     ~dynamics.customerinsights.api.models.SqlValidationStats
    :param evaluation_status_history: Gets the segment evaluation status
     history. (not persisted in store)
    :type evaluation_status_history:
     list[~dynamics.customerinsights.api.models.HistoricalSegmentStats]
    :param segment_query_stats:
    :type segment_query_stats:
     ~dynamics.customerinsights.api.models.SegmentQueryStat
    :param version: Version number of this object.
    :type version: long
    :param updated_by: UPN of the user who last updated this record.
    :type updated_by: str
    :param updated_utc: Time this object was last updated.
    :type updated_utc: datetime
    :param created_by: Email address of the user who created this record.
    :type created_by: str
    :param created_utc: Time this object was initially created.
    :type created_utc: datetime
    :param instance_id: Customer Insights instance id associated with this
     object.
    :type instance_id: str
    """

    _attribute_map = {
        'kind': {'key': 'kind', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'friendly_name': {'key': 'friendlyName', 'type': 'str'},
        'description': {'key': 'description', 'type': 'str'},
        'segment_query_expression': {'key': 'segmentQueryExpression', 'type': 'SegmentationQuery'},
        'state': {'key': 'state', 'type': 'str'},
        'error_description': {'key': 'errorDescription', 'type': 'str'},
        'end_date': {'key': 'endDate', 'type': 'iso-8601'},
        'evaluation_status': {'key': 'evaluationStatus', 'type': 'SegmentationPublishStats'},
        'sql_validation_stats': {'key': 'sqlValidationStats', 'type': 'SqlValidationStats'},
        'evaluation_status_history': {'key': 'evaluationStatusHistory', 'type': '[HistoricalSegmentStats]'},
        'segment_query_stats': {'key': 'segmentQueryStats', 'type': 'SegmentQueryStat'},
        'version': {'key': 'version', 'type': 'long'},
        'updated_by': {'key': 'updatedBy', 'type': 'str'},
        'updated_utc': {'key': 'updatedUtc', 'type': 'iso-8601'},
        'created_by': {'key': 'createdBy', 'type': 'str'},
        'created_utc': {'key': 'createdUtc', 'type': 'iso-8601'},
        'instance_id': {'key': 'instanceId', 'type': 'str'},
    }

    def __init__(self, **kwargs):
        super(SegmentMetadata, self).__init__(**kwargs)
        self.kind = kwargs.get('kind', None)
        self.name = kwargs.get('name', None)
        self.friendly_name = kwargs.get('friendly_name', None)
        self.description = kwargs.get('description', None)
        self.segment_query_expression = kwargs.get('segment_query_expression', None)
        self.state = kwargs.get('state', None)
        self.error_description = kwargs.get('error_description', None)
        self.end_date = kwargs.get('end_date', None)
        self.evaluation_status = kwargs.get('evaluation_status', None)
        self.sql_validation_stats = kwargs.get('sql_validation_stats', None)
        self.evaluation_status_history = kwargs.get('evaluation_status_history', None)
        self.segment_query_stats = kwargs.get('segment_query_stats', None)
        self.version = kwargs.get('version', None)
        self.updated_by = kwargs.get('updated_by', None)
        self.updated_utc = kwargs.get('updated_utc', None)
        self.created_by = kwargs.get('created_by', None)
        self.created_utc = kwargs.get('created_utc', None)
        self.instance_id = kwargs.get('instance_id', None)
