# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.core.exceptions import HttpResponseError
import msrest.serialization


class AlignPolicy(msrest.serialization.Model):
    """AlignPolicy.

    :ivar align_mode: An optional field, indicating how we align different variables to the same
     time-range. Either Inner or Outer. Possible values include: "Inner", "Outer".
    :vartype align_mode: str or ~azure.ai.anomalydetector.models.AlignMode
    :ivar fill_na_method: An optional field, indicating how missing values will be filled. One of
     Previous, Subsequent, Linear, Zero, Fixed, and NotFill. Cannot be set to NotFill, when the
     alignMode is Outer. Possible values include: "Previous", "Subsequent", "Linear", "Zero",
     "Fixed", "NotFill".
    :vartype fill_na_method: str or ~azure.ai.anomalydetector.models.FillNAMethod
    :ivar padding_value: An optional field. Required when fillNAMethod is Fixed.
    :vartype padding_value: float
    """

    _attribute_map = {
        'align_mode': {'key': 'alignMode', 'type': 'str'},
        'fill_na_method': {'key': 'fillNAMethod', 'type': 'str'},
        'padding_value': {'key': 'paddingValue', 'type': 'float'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword align_mode: An optional field, indicating how we align different variables to the same
         time-range. Either Inner or Outer. Possible values include: "Inner", "Outer".
        :paramtype align_mode: str or ~azure.ai.anomalydetector.models.AlignMode
        :keyword fill_na_method: An optional field, indicating how missing values will be filled. One
         of Previous, Subsequent, Linear, Zero, Fixed, and NotFill. Cannot be set to NotFill, when the
         alignMode is Outer. Possible values include: "Previous", "Subsequent", "Linear", "Zero",
         "Fixed", "NotFill".
        :paramtype fill_na_method: str or ~azure.ai.anomalydetector.models.FillNAMethod
        :keyword padding_value: An optional field. Required when fillNAMethod is Fixed.
        :paramtype padding_value: float
        """
        super(AlignPolicy, self).__init__(**kwargs)
        self.align_mode = kwargs.get('align_mode', None)
        self.fill_na_method = kwargs.get('fill_na_method', None)
        self.padding_value = kwargs.get('padding_value', None)


class AnomalyDetectorError(msrest.serialization.Model):
    """Error information returned by the API.

    :ivar code: The error code. Possible values include: "InvalidCustomInterval", "BadArgument",
     "InvalidGranularity", "InvalidPeriod", "InvalidModelArgument", "InvalidSeries",
     "InvalidJsonFormat", "RequiredGranularity", "RequiredSeries", "InvalidImputeMode",
     "InvalidImputeFixedValue".
    :vartype code: str or ~azure.ai.anomalydetector.models.AnomalyDetectorErrorCodes
    :ivar message: A message explaining the error reported by the service.
    :vartype message: str
    """

    _attribute_map = {
        'code': {'key': 'code', 'type': 'str'},
        'message': {'key': 'message', 'type': 'str'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword code: The error code. Possible values include: "InvalidCustomInterval", "BadArgument",
         "InvalidGranularity", "InvalidPeriod", "InvalidModelArgument", "InvalidSeries",
         "InvalidJsonFormat", "RequiredGranularity", "RequiredSeries", "InvalidImputeMode",
         "InvalidImputeFixedValue".
        :paramtype code: str or ~azure.ai.anomalydetector.models.AnomalyDetectorErrorCodes
        :keyword message: A message explaining the error reported by the service.
        :paramtype message: str
        """
        super(AnomalyDetectorError, self).__init__(**kwargs)
        self.code = kwargs.get('code', None)
        self.message = kwargs.get('message', None)


class AnomalyInterpretation(msrest.serialization.Model):
    """AnomalyInterpretation.

    :ivar variable:
    :vartype variable: str
    :ivar contribution_score:
    :vartype contribution_score: float
    :ivar correlation_changes:
    :vartype correlation_changes: ~azure.ai.anomalydetector.models.CorrelationChanges
    """

    _attribute_map = {
        'variable': {'key': 'variable', 'type': 'str'},
        'contribution_score': {'key': 'contributionScore', 'type': 'float'},
        'correlation_changes': {'key': 'correlationChanges', 'type': 'CorrelationChanges'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword variable:
        :paramtype variable: str
        :keyword contribution_score:
        :paramtype contribution_score: float
        :keyword correlation_changes:
        :paramtype correlation_changes: ~azure.ai.anomalydetector.models.CorrelationChanges
        """
        super(AnomalyInterpretation, self).__init__(**kwargs)
        self.variable = kwargs.get('variable', None)
        self.contribution_score = kwargs.get('contribution_score', None)
        self.correlation_changes = kwargs.get('correlation_changes', None)


class AnomalyState(msrest.serialization.Model):
    """AnomalyState.

    All required parameters must be populated in order to send to Azure.

    :ivar timestamp: Required. timestamp.
    :vartype timestamp: ~datetime.datetime
    :ivar value:
    :vartype value: ~azure.ai.anomalydetector.models.AnomalyValue
    :ivar errors: Error message for the current timestamp.
    :vartype errors: list[~azure.ai.anomalydetector.models.ErrorResponse]
    """

    _validation = {
        'timestamp': {'required': True},
    }

    _attribute_map = {
        'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
        'value': {'key': 'value', 'type': 'AnomalyValue'},
        'errors': {'key': 'errors', 'type': '[ErrorResponse]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword timestamp: Required. timestamp.
        :paramtype timestamp: ~datetime.datetime
        :keyword value:
        :paramtype value: ~azure.ai.anomalydetector.models.AnomalyValue
        :keyword errors: Error message for the current timestamp.
        :paramtype errors: list[~azure.ai.anomalydetector.models.ErrorResponse]
        """
        super(AnomalyState, self).__init__(**kwargs)
        self.timestamp = kwargs['timestamp']
        self.value = kwargs.get('value', None)
        self.errors = kwargs.get('errors', None)


class AnomalyValue(msrest.serialization.Model):
    """AnomalyValue.

    All required parameters must be populated in order to send to Azure.

    :ivar is_anomaly: Required. True if an anomaly is detected at the current timestamp.
    :vartype is_anomaly: bool
    :ivar severity: Required. Indicates the significance of the anomaly. The higher the severity,
     the more significant the anomaly.
    :vartype severity: float
    :ivar score: Required. Raw score from the model.
    :vartype score: float
    :ivar interpretation:
    :vartype interpretation: list[~azure.ai.anomalydetector.models.AnomalyInterpretation]
    """

    _validation = {
        'is_anomaly': {'required': True},
        'severity': {'required': True, 'maximum': 1, 'minimum': 0},
        'score': {'required': True, 'maximum': 2, 'minimum': 0},
    }

    _attribute_map = {
        'is_anomaly': {'key': 'isAnomaly', 'type': 'bool'},
        'severity': {'key': 'severity', 'type': 'float'},
        'score': {'key': 'score', 'type': 'float'},
        'interpretation': {'key': 'interpretation', 'type': '[AnomalyInterpretation]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword is_anomaly: Required. True if an anomaly is detected at the current timestamp.
        :paramtype is_anomaly: bool
        :keyword severity: Required. Indicates the significance of the anomaly. The higher the
         severity, the more significant the anomaly.
        :paramtype severity: float
        :keyword score: Required. Raw score from the model.
        :paramtype score: float
        :keyword interpretation:
        :paramtype interpretation: list[~azure.ai.anomalydetector.models.AnomalyInterpretation]
        """
        super(AnomalyValue, self).__init__(**kwargs)
        self.is_anomaly = kwargs['is_anomaly']
        self.severity = kwargs['severity']
        self.score = kwargs['score']
        self.interpretation = kwargs.get('interpretation', None)


class ChangePointDetectRequest(msrest.serialization.Model):
    """The request of change point detection.

    All required parameters must be populated in order to send to Azure.

    :ivar series: Required. Time series data points. Points should be sorted by timestamp in
     ascending order to match the change point detection result.
    :vartype series: list[~azure.ai.anomalydetector.models.TimeSeriesPoint]
    :ivar granularity: Required. Can only be one of yearly, monthly, weekly, daily, hourly,
     minutely or secondly. Granularity is used for verify whether input series is valid. Possible
     values include: "yearly", "monthly", "weekly", "daily", "hourly", "minutely", "secondly",
     "microsecond", "none".
    :vartype granularity: str or ~azure.ai.anomalydetector.models.TimeGranularity
    :ivar custom_interval: Custom Interval is used to set non-standard time interval, for example,
     if the series is 5 minutes, request can be set as {"granularity":"minutely",
     "customInterval":5}.
    :vartype custom_interval: int
    :ivar period: Optional argument, periodic value of a time series. If the value is null or does
     not present, the API will determine the period automatically.
    :vartype period: int
    :ivar stable_trend_window: Optional argument, advanced model parameter, a default
     stableTrendWindow will be used in detection.
    :vartype stable_trend_window: int
    :ivar threshold: Optional argument, advanced model parameter, between 0.0-1.0, the lower the
     value is, the larger the trend error will be which means less change point will be accepted.
    :vartype threshold: float
    """

    _validation = {
        'series': {'required': True},
        'granularity': {'required': True},
    }

    _attribute_map = {
        'series': {'key': 'series', 'type': '[TimeSeriesPoint]'},
        'granularity': {'key': 'granularity', 'type': 'str'},
        'custom_interval': {'key': 'customInterval', 'type': 'int'},
        'period': {'key': 'period', 'type': 'int'},
        'stable_trend_window': {'key': 'stableTrendWindow', 'type': 'int'},
        'threshold': {'key': 'threshold', 'type': 'float'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword series: Required. Time series data points. Points should be sorted by timestamp in
         ascending order to match the change point detection result.
        :paramtype series: list[~azure.ai.anomalydetector.models.TimeSeriesPoint]
        :keyword granularity: Required. Can only be one of yearly, monthly, weekly, daily, hourly,
         minutely or secondly. Granularity is used for verify whether input series is valid. Possible
         values include: "yearly", "monthly", "weekly", "daily", "hourly", "minutely", "secondly",
         "microsecond", "none".
        :paramtype granularity: str or ~azure.ai.anomalydetector.models.TimeGranularity
        :keyword custom_interval: Custom Interval is used to set non-standard time interval, for
         example, if the series is 5 minutes, request can be set as {"granularity":"minutely",
         "customInterval":5}.
        :paramtype custom_interval: int
        :keyword period: Optional argument, periodic value of a time series. If the value is null or
         does not present, the API will determine the period automatically.
        :paramtype period: int
        :keyword stable_trend_window: Optional argument, advanced model parameter, a default
         stableTrendWindow will be used in detection.
        :paramtype stable_trend_window: int
        :keyword threshold: Optional argument, advanced model parameter, between 0.0-1.0, the lower the
         value is, the larger the trend error will be which means less change point will be accepted.
        :paramtype threshold: float
        """
        super(ChangePointDetectRequest, self).__init__(**kwargs)
        self.series = kwargs['series']
        self.granularity = kwargs['granularity']
        self.custom_interval = kwargs.get('custom_interval', None)
        self.period = kwargs.get('period', None)
        self.stable_trend_window = kwargs.get('stable_trend_window', None)
        self.threshold = kwargs.get('threshold', None)


class ChangePointDetectResponse(msrest.serialization.Model):
    """The response of change point detection.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar period: Frequency extracted from the series, zero means no recurrent pattern has been
     found.
    :vartype period: int
    :ivar is_change_point: isChangePoint contains change point properties for each input point.
     True means an anomaly either negative or positive has been detected. The index of the array is
     consistent with the input series.
    :vartype is_change_point: list[bool]
    :ivar confidence_scores: the change point confidence of each point.
    :vartype confidence_scores: list[float]
    """

    _validation = {
        'period': {'readonly': True},
    }

    _attribute_map = {
        'period': {'key': 'period', 'type': 'int'},
        'is_change_point': {'key': 'isChangePoint', 'type': '[bool]'},
        'confidence_scores': {'key': 'confidenceScores', 'type': '[float]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword is_change_point: isChangePoint contains change point properties for each input point.
         True means an anomaly either negative or positive has been detected. The index of the array is
         consistent with the input series.
        :paramtype is_change_point: list[bool]
        :keyword confidence_scores: the change point confidence of each point.
        :paramtype confidence_scores: list[float]
        """
        super(ChangePointDetectResponse, self).__init__(**kwargs)
        self.period = None
        self.is_change_point = kwargs.get('is_change_point', None)
        self.confidence_scores = kwargs.get('confidence_scores', None)


class CorrelationChanges(msrest.serialization.Model):
    """CorrelationChanges.

    :ivar changed_variables: correlated variables.
    :vartype changed_variables: list[str]
    :ivar changed_values: changes in correlation.
    :vartype changed_values: list[float]
    """

    _attribute_map = {
        'changed_variables': {'key': 'changedVariables', 'type': '[str]'},
        'changed_values': {'key': 'changedValues', 'type': '[float]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword changed_variables: correlated variables.
        :paramtype changed_variables: list[str]
        :keyword changed_values: changes in correlation.
        :paramtype changed_values: list[float]
        """
        super(CorrelationChanges, self).__init__(**kwargs)
        self.changed_variables = kwargs.get('changed_variables', None)
        self.changed_values = kwargs.get('changed_values', None)


class DetectionRequest(msrest.serialization.Model):
    """Detection request.

    All required parameters must be populated in order to send to Azure.

    :ivar source: Required. Source link to the input variables. Each variable should be a csv with
     two columns, ``timestamp`` and ``value``. The file name of the variable will be used as its
     name. The variables used in detection should be exactly the same with those used in the
     training phase.
    :vartype source: str
    :ivar start_time: Required. A required field, indicating the start time of data for detection.
     Should be date-time.
    :vartype start_time: ~datetime.datetime
    :ivar end_time: Required. A required field, indicating the end time of data for detection.
     Should be date-time.
    :vartype end_time: ~datetime.datetime
    """

    _validation = {
        'source': {'required': True},
        'start_time': {'required': True},
        'end_time': {'required': True},
    }

    _attribute_map = {
        'source': {'key': 'source', 'type': 'str'},
        'start_time': {'key': 'startTime', 'type': 'iso-8601'},
        'end_time': {'key': 'endTime', 'type': 'iso-8601'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword source: Required. Source link to the input variables. Each variable should be a csv
         with two columns, ``timestamp`` and ``value``. The file name of the variable will be used as
         its name. The variables used in detection should be exactly the same with those used in the
         training phase.
        :paramtype source: str
        :keyword start_time: Required. A required field, indicating the start time of data for
         detection. Should be date-time.
        :paramtype start_time: ~datetime.datetime
        :keyword end_time: Required. A required field, indicating the end time of data for detection.
         Should be date-time.
        :paramtype end_time: ~datetime.datetime
        """
        super(DetectionRequest, self).__init__(**kwargs)
        self.source = kwargs['source']
        self.start_time = kwargs['start_time']
        self.end_time = kwargs['end_time']


class DetectionResult(msrest.serialization.Model):
    """Response of the given resultId.

    All required parameters must be populated in order to send to Azure.

    :ivar result_id: Required.
    :vartype result_id: str
    :ivar summary: Required.
    :vartype summary: ~azure.ai.anomalydetector.models.DetectionResultSummary
    :ivar results: Required. Detection result for each timestamp.
    :vartype results: list[~azure.ai.anomalydetector.models.AnomalyState]
    """

    _validation = {
        'result_id': {'required': True},
        'summary': {'required': True},
        'results': {'required': True},
    }

    _attribute_map = {
        'result_id': {'key': 'resultId', 'type': 'str'},
        'summary': {'key': 'summary', 'type': 'DetectionResultSummary'},
        'results': {'key': 'results', 'type': '[AnomalyState]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword result_id: Required.
        :paramtype result_id: str
        :keyword summary: Required.
        :paramtype summary: ~azure.ai.anomalydetector.models.DetectionResultSummary
        :keyword results: Required. Detection result for each timestamp.
        :paramtype results: list[~azure.ai.anomalydetector.models.AnomalyState]
        """
        super(DetectionResult, self).__init__(**kwargs)
        self.result_id = kwargs['result_id']
        self.summary = kwargs['summary']
        self.results = kwargs['results']


class DetectionResultSummary(msrest.serialization.Model):
    """DetectionResultSummary.

    All required parameters must be populated in order to send to Azure.

    :ivar status: Required. Status of detection results. One of CREATED, RUNNING, READY, and
     FAILED. Possible values include: "CREATED", "RUNNING", "READY", "FAILED".
    :vartype status: str or ~azure.ai.anomalydetector.models.DetectionStatus
    :ivar errors: Error message when detection is failed.
    :vartype errors: list[~azure.ai.anomalydetector.models.ErrorResponse]
    :ivar variable_states:
    :vartype variable_states: list[~azure.ai.anomalydetector.models.VariableState]
    :ivar setup_info: Required. Detection request.
    :vartype setup_info: ~azure.ai.anomalydetector.models.DetectionRequest
    """

    _validation = {
        'status': {'required': True},
        'setup_info': {'required': True},
    }

    _attribute_map = {
        'status': {'key': 'status', 'type': 'str'},
        'errors': {'key': 'errors', 'type': '[ErrorResponse]'},
        'variable_states': {'key': 'variableStates', 'type': '[VariableState]'},
        'setup_info': {'key': 'setupInfo', 'type': 'DetectionRequest'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword status: Required. Status of detection results. One of CREATED, RUNNING, READY, and
         FAILED. Possible values include: "CREATED", "RUNNING", "READY", "FAILED".
        :paramtype status: str or ~azure.ai.anomalydetector.models.DetectionStatus
        :keyword errors: Error message when detection is failed.
        :paramtype errors: list[~azure.ai.anomalydetector.models.ErrorResponse]
        :keyword variable_states:
        :paramtype variable_states: list[~azure.ai.anomalydetector.models.VariableState]
        :keyword setup_info: Required. Detection request.
        :paramtype setup_info: ~azure.ai.anomalydetector.models.DetectionRequest
        """
        super(DetectionResultSummary, self).__init__(**kwargs)
        self.status = kwargs['status']
        self.errors = kwargs.get('errors', None)
        self.variable_states = kwargs.get('variable_states', None)
        self.setup_info = kwargs['setup_info']


class DetectRequest(msrest.serialization.Model):
    """The request of entire or last anomaly detection.

    All required parameters must be populated in order to send to Azure.

    :ivar series: Required. Time series data points. Points should be sorted by timestamp in
     ascending order to match the anomaly detection result. If the data is not sorted correctly or
     there is duplicated timestamp, the API will not work. In such case, an error message will be
     returned.
    :vartype series: list[~azure.ai.anomalydetector.models.TimeSeriesPoint]
    :ivar granularity: Optional argument, can be one of yearly, monthly, weekly, daily, hourly,
     minutely, secondly, microsecond or none. If granularity is not present, it will be none by
     default. If granularity is none, the timestamp property in time series point can be absent.
     Possible values include: "yearly", "monthly", "weekly", "daily", "hourly", "minutely",
     "secondly", "microsecond", "none".
    :vartype granularity: str or ~azure.ai.anomalydetector.models.TimeGranularity
    :ivar custom_interval: Custom Interval is used to set non-standard time interval, for example,
     if the series is 5 minutes, request can be set as {"granularity":"minutely",
     "customInterval":5}.
    :vartype custom_interval: int
    :ivar period: Optional argument, periodic value of a time series. If the value is null or does
     not present, the API will determine the period automatically.
    :vartype period: int
    :ivar max_anomaly_ratio: Optional argument, advanced model parameter, max anomaly ratio in a
     time series.
    :vartype max_anomaly_ratio: float
    :ivar sensitivity: Optional argument, advanced model parameter, between 0-99, the lower the
     value is, the larger the margin value will be which means less anomalies will be accepted.
    :vartype sensitivity: int
    :ivar impute_mode: Used to specify how to deal with missing values in the input series, it's
     used when granularity is not "none". Possible values include: "auto", "previous", "linear",
     "fixed", "zero", "notFill".
    :vartype impute_mode: str or ~azure.ai.anomalydetector.models.ImputeMode
    :ivar impute_fixed_value: Used to specify the value to fill, it's used when granularity is not
     "none" and imputeMode is "fixed".
    :vartype impute_fixed_value: float
    """

    _validation = {
        'series': {'required': True},
    }

    _attribute_map = {
        'series': {'key': 'series', 'type': '[TimeSeriesPoint]'},
        'granularity': {'key': 'granularity', 'type': 'str'},
        'custom_interval': {'key': 'customInterval', 'type': 'int'},
        'period': {'key': 'period', 'type': 'int'},
        'max_anomaly_ratio': {'key': 'maxAnomalyRatio', 'type': 'float'},
        'sensitivity': {'key': 'sensitivity', 'type': 'int'},
        'impute_mode': {'key': 'imputeMode', 'type': 'str'},
        'impute_fixed_value': {'key': 'imputeFixedValue', 'type': 'float'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword series: Required. Time series data points. Points should be sorted by timestamp in
         ascending order to match the anomaly detection result. If the data is not sorted correctly or
         there is duplicated timestamp, the API will not work. In such case, an error message will be
         returned.
        :paramtype series: list[~azure.ai.anomalydetector.models.TimeSeriesPoint]
        :keyword granularity: Optional argument, can be one of yearly, monthly, weekly, daily, hourly,
         minutely, secondly, microsecond or none. If granularity is not present, it will be none by
         default. If granularity is none, the timestamp property in time series point can be absent.
         Possible values include: "yearly", "monthly", "weekly", "daily", "hourly", "minutely",
         "secondly", "microsecond", "none".
        :paramtype granularity: str or ~azure.ai.anomalydetector.models.TimeGranularity
        :keyword custom_interval: Custom Interval is used to set non-standard time interval, for
         example, if the series is 5 minutes, request can be set as {"granularity":"minutely",
         "customInterval":5}.
        :paramtype custom_interval: int
        :keyword period: Optional argument, periodic value of a time series. If the value is null or
         does not present, the API will determine the period automatically.
        :paramtype period: int
        :keyword max_anomaly_ratio: Optional argument, advanced model parameter, max anomaly ratio in a
         time series.
        :paramtype max_anomaly_ratio: float
        :keyword sensitivity: Optional argument, advanced model parameter, between 0-99, the lower the
         value is, the larger the margin value will be which means less anomalies will be accepted.
        :paramtype sensitivity: int
        :keyword impute_mode: Used to specify how to deal with missing values in the input series, it's
         used when granularity is not "none". Possible values include: "auto", "previous", "linear",
         "fixed", "zero", "notFill".
        :paramtype impute_mode: str or ~azure.ai.anomalydetector.models.ImputeMode
        :keyword impute_fixed_value: Used to specify the value to fill, it's used when granularity is
         not "none" and imputeMode is "fixed".
        :paramtype impute_fixed_value: float
        """
        super(DetectRequest, self).__init__(**kwargs)
        self.series = kwargs['series']
        self.granularity = kwargs.get('granularity', None)
        self.custom_interval = kwargs.get('custom_interval', None)
        self.period = kwargs.get('period', None)
        self.max_anomaly_ratio = kwargs.get('max_anomaly_ratio', None)
        self.sensitivity = kwargs.get('sensitivity', None)
        self.impute_mode = kwargs.get('impute_mode', None)
        self.impute_fixed_value = kwargs.get('impute_fixed_value', None)


class DiagnosticsInfo(msrest.serialization.Model):
    """DiagnosticsInfo.

    :ivar model_state:
    :vartype model_state: ~azure.ai.anomalydetector.models.ModelState
    :ivar variable_states:
    :vartype variable_states: list[~azure.ai.anomalydetector.models.VariableState]
    """

    _attribute_map = {
        'model_state': {'key': 'modelState', 'type': 'ModelState'},
        'variable_states': {'key': 'variableStates', 'type': '[VariableState]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword model_state:
        :paramtype model_state: ~azure.ai.anomalydetector.models.ModelState
        :keyword variable_states:
        :paramtype variable_states: list[~azure.ai.anomalydetector.models.VariableState]
        """
        super(DiagnosticsInfo, self).__init__(**kwargs)
        self.model_state = kwargs.get('model_state', None)
        self.variable_states = kwargs.get('variable_states', None)


class EntireDetectResponse(msrest.serialization.Model):
    """The response of entire anomaly detection.

    All required parameters must be populated in order to send to Azure.

    :ivar period: Required. Frequency extracted from the series, zero means no recurrent pattern
     has been found.
    :vartype period: int
    :ivar expected_values: Required. ExpectedValues contain expected value for each input point.
     The index of the array is consistent with the input series.
    :vartype expected_values: list[float]
    :ivar upper_margins: Required. UpperMargins contain upper margin of each input point.
     UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 -
     marginScale)*upperMargin. Anomalies in response can be filtered by upperBoundary and
     lowerBoundary. By adjusting marginScale value, less significant anomalies can be filtered in
     client side. The index of the array is consistent with the input series.
    :vartype upper_margins: list[float]
    :ivar lower_margins: Required. LowerMargins contain lower margin of each input point.
     LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 -
     marginScale)*lowerMargin. Points between the boundary can be marked as normal ones in client
     side. The index of the array is consistent with the input series.
    :vartype lower_margins: list[float]
    :ivar is_anomaly: Required. IsAnomaly contains anomaly properties for each input point. True
     means an anomaly either negative or positive has been detected. The index of the array is
     consistent with the input series.
    :vartype is_anomaly: list[bool]
    :ivar is_negative_anomaly: Required. IsNegativeAnomaly contains anomaly status in negative
     direction for each input point. True means a negative anomaly has been detected. A negative
     anomaly means the point is detected as an anomaly and its real value is smaller than the
     expected one. The index of the array is consistent with the input series.
    :vartype is_negative_anomaly: list[bool]
    :ivar is_positive_anomaly: Required. IsPositiveAnomaly contain anomaly status in positive
     direction for each input point. True means a positive anomaly has been detected. A positive
     anomaly means the point is detected as an anomaly and its real value is larger than the
     expected one. The index of the array is consistent with the input series.
    :vartype is_positive_anomaly: list[bool]
    :ivar severity: The severity score for each input point. The larger the value is, the more
     sever the anomaly is. For normal points, the "severity" is always 0.
    :vartype severity: list[float]
    """

    _validation = {
        'period': {'required': True},
        'expected_values': {'required': True},
        'upper_margins': {'required': True},
        'lower_margins': {'required': True},
        'is_anomaly': {'required': True},
        'is_negative_anomaly': {'required': True},
        'is_positive_anomaly': {'required': True},
    }

    _attribute_map = {
        'period': {'key': 'period', 'type': 'int'},
        'expected_values': {'key': 'expectedValues', 'type': '[float]'},
        'upper_margins': {'key': 'upperMargins', 'type': '[float]'},
        'lower_margins': {'key': 'lowerMargins', 'type': '[float]'},
        'is_anomaly': {'key': 'isAnomaly', 'type': '[bool]'},
        'is_negative_anomaly': {'key': 'isNegativeAnomaly', 'type': '[bool]'},
        'is_positive_anomaly': {'key': 'isPositiveAnomaly', 'type': '[bool]'},
        'severity': {'key': 'severity', 'type': '[float]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword period: Required. Frequency extracted from the series, zero means no recurrent pattern
         has been found.
        :paramtype period: int
        :keyword expected_values: Required. ExpectedValues contain expected value for each input point.
         The index of the array is consistent with the input series.
        :paramtype expected_values: list[float]
        :keyword upper_margins: Required. UpperMargins contain upper margin of each input point.
         UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 -
         marginScale)*upperMargin. Anomalies in response can be filtered by upperBoundary and
         lowerBoundary. By adjusting marginScale value, less significant anomalies can be filtered in
         client side. The index of the array is consistent with the input series.
        :paramtype upper_margins: list[float]
        :keyword lower_margins: Required. LowerMargins contain lower margin of each input point.
         LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 -
         marginScale)*lowerMargin. Points between the boundary can be marked as normal ones in client
         side. The index of the array is consistent with the input series.
        :paramtype lower_margins: list[float]
        :keyword is_anomaly: Required. IsAnomaly contains anomaly properties for each input point. True
         means an anomaly either negative or positive has been detected. The index of the array is
         consistent with the input series.
        :paramtype is_anomaly: list[bool]
        :keyword is_negative_anomaly: Required. IsNegativeAnomaly contains anomaly status in negative
         direction for each input point. True means a negative anomaly has been detected. A negative
         anomaly means the point is detected as an anomaly and its real value is smaller than the
         expected one. The index of the array is consistent with the input series.
        :paramtype is_negative_anomaly: list[bool]
        :keyword is_positive_anomaly: Required. IsPositiveAnomaly contain anomaly status in positive
         direction for each input point. True means a positive anomaly has been detected. A positive
         anomaly means the point is detected as an anomaly and its real value is larger than the
         expected one. The index of the array is consistent with the input series.
        :paramtype is_positive_anomaly: list[bool]
        :keyword severity: The severity score for each input point. The larger the value is, the more
         sever the anomaly is. For normal points, the "severity" is always 0.
        :paramtype severity: list[float]
        """
        super(EntireDetectResponse, self).__init__(**kwargs)
        self.period = kwargs['period']
        self.expected_values = kwargs['expected_values']
        self.upper_margins = kwargs['upper_margins']
        self.lower_margins = kwargs['lower_margins']
        self.is_anomaly = kwargs['is_anomaly']
        self.is_negative_anomaly = kwargs['is_negative_anomaly']
        self.is_positive_anomaly = kwargs['is_positive_anomaly']
        self.severity = kwargs.get('severity', None)


class ErrorResponse(msrest.serialization.Model):
    """ErrorResponse.

    All required parameters must be populated in order to send to Azure.

    :ivar code: Required. The error code.
    :vartype code: str
    :ivar message: Required. The message explaining the error reported by the service.
    :vartype message: str
    """

    _validation = {
        'code': {'required': True},
        'message': {'required': True},
    }

    _attribute_map = {
        'code': {'key': 'code', 'type': 'str'},
        'message': {'key': 'message', 'type': 'str'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword code: Required. The error code.
        :paramtype code: str
        :keyword message: Required. The message explaining the error reported by the service.
        :paramtype message: str
        """
        super(ErrorResponse, self).__init__(**kwargs)
        self.code = kwargs['code']
        self.message = kwargs['message']


class LastDetectionRequest(msrest.serialization.Model):
    """LastDetectionRequest.

    All required parameters must be populated in order to send to Azure.

    :ivar variables: Required. variables.
    :vartype variables: list[~azure.ai.anomalydetector.models.VariableValues]
    :ivar detecting_points: Required. number of timestamps on which the model detects.
    :vartype detecting_points: int
    """

    _validation = {
        'variables': {'required': True},
        'detecting_points': {'required': True},
    }

    _attribute_map = {
        'variables': {'key': 'variables', 'type': '[VariableValues]'},
        'detecting_points': {'key': 'detectingPoints', 'type': 'int'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword variables: Required. variables.
        :paramtype variables: list[~azure.ai.anomalydetector.models.VariableValues]
        :keyword detecting_points: Required. number of timestamps on which the model detects.
        :paramtype detecting_points: int
        """
        super(LastDetectionRequest, self).__init__(**kwargs)
        self.variables = kwargs['variables']
        self.detecting_points = kwargs['detecting_points']


class LastDetectionResult(msrest.serialization.Model):
    """LastDetectionResult.

    :ivar variable_states:
    :vartype variable_states: list[~azure.ai.anomalydetector.models.VariableState]
    :ivar results:
    :vartype results: list[~azure.ai.anomalydetector.models.AnomalyState]
    """

    _attribute_map = {
        'variable_states': {'key': 'variableStates', 'type': '[VariableState]'},
        'results': {'key': 'results', 'type': '[AnomalyState]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword variable_states:
        :paramtype variable_states: list[~azure.ai.anomalydetector.models.VariableState]
        :keyword results:
        :paramtype results: list[~azure.ai.anomalydetector.models.AnomalyState]
        """
        super(LastDetectionResult, self).__init__(**kwargs)
        self.variable_states = kwargs.get('variable_states', None)
        self.results = kwargs.get('results', None)


class LastDetectResponse(msrest.serialization.Model):
    """The response of last anomaly detection.

    All required parameters must be populated in order to send to Azure.

    :ivar period: Required. Frequency extracted from the series, zero means no recurrent pattern
     has been found.
    :vartype period: int
    :ivar suggested_window: Required. Suggested input series points needed for detecting the latest
     point.
    :vartype suggested_window: int
    :ivar expected_value: Required. Expected value of the latest point.
    :vartype expected_value: float
    :ivar upper_margin: Required. Upper margin of the latest point. UpperMargin is used to
     calculate upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. If
     the value of latest point is between upperBoundary and lowerBoundary, it should be treated as
     normal value. By adjusting marginScale value, anomaly status of latest point can be changed.
    :vartype upper_margin: float
    :ivar lower_margin: Required. Lower margin of the latest point. LowerMargin is used to
     calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin.
    :vartype lower_margin: float
    :ivar is_anomaly: Required. Anomaly status of the latest point, true means the latest point is
     an anomaly either in negative direction or positive direction.
    :vartype is_anomaly: bool
    :ivar is_negative_anomaly: Required. Anomaly status in negative direction of the latest point.
     True means the latest point is an anomaly and its real value is smaller than the expected one.
    :vartype is_negative_anomaly: bool
    :ivar is_positive_anomaly: Required. Anomaly status in positive direction of the latest point.
     True means the latest point is an anomaly and its real value is larger than the expected one.
    :vartype is_positive_anomaly: bool
    :ivar severity: The severity score for the last input point. The larger the value is, the more
     sever the anomaly is. For normal points, the "severity" is always 0.
    :vartype severity: float
    """

    _validation = {
        'period': {'required': True},
        'suggested_window': {'required': True},
        'expected_value': {'required': True},
        'upper_margin': {'required': True},
        'lower_margin': {'required': True},
        'is_anomaly': {'required': True},
        'is_negative_anomaly': {'required': True},
        'is_positive_anomaly': {'required': True},
    }

    _attribute_map = {
        'period': {'key': 'period', 'type': 'int'},
        'suggested_window': {'key': 'suggestedWindow', 'type': 'int'},
        'expected_value': {'key': 'expectedValue', 'type': 'float'},
        'upper_margin': {'key': 'upperMargin', 'type': 'float'},
        'lower_margin': {'key': 'lowerMargin', 'type': 'float'},
        'is_anomaly': {'key': 'isAnomaly', 'type': 'bool'},
        'is_negative_anomaly': {'key': 'isNegativeAnomaly', 'type': 'bool'},
        'is_positive_anomaly': {'key': 'isPositiveAnomaly', 'type': 'bool'},
        'severity': {'key': 'severity', 'type': 'float'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword period: Required. Frequency extracted from the series, zero means no recurrent pattern
         has been found.
        :paramtype period: int
        :keyword suggested_window: Required. Suggested input series points needed for detecting the
         latest point.
        :paramtype suggested_window: int
        :keyword expected_value: Required. Expected value of the latest point.
        :paramtype expected_value: float
        :keyword upper_margin: Required. Upper margin of the latest point. UpperMargin is used to
         calculate upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. If
         the value of latest point is between upperBoundary and lowerBoundary, it should be treated as
         normal value. By adjusting marginScale value, anomaly status of latest point can be changed.
        :paramtype upper_margin: float
        :keyword lower_margin: Required. Lower margin of the latest point. LowerMargin is used to
         calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin.
        :paramtype lower_margin: float
        :keyword is_anomaly: Required. Anomaly status of the latest point, true means the latest point
         is an anomaly either in negative direction or positive direction.
        :paramtype is_anomaly: bool
        :keyword is_negative_anomaly: Required. Anomaly status in negative direction of the latest
         point. True means the latest point is an anomaly and its real value is smaller than the
         expected one.
        :paramtype is_negative_anomaly: bool
        :keyword is_positive_anomaly: Required. Anomaly status in positive direction of the latest
         point. True means the latest point is an anomaly and its real value is larger than the expected
         one.
        :paramtype is_positive_anomaly: bool
        :keyword severity: The severity score for the last input point. The larger the value is, the
         more sever the anomaly is. For normal points, the "severity" is always 0.
        :paramtype severity: float
        """
        super(LastDetectResponse, self).__init__(**kwargs)
        self.period = kwargs['period']
        self.suggested_window = kwargs['suggested_window']
        self.expected_value = kwargs['expected_value']
        self.upper_margin = kwargs['upper_margin']
        self.lower_margin = kwargs['lower_margin']
        self.is_anomaly = kwargs['is_anomaly']
        self.is_negative_anomaly = kwargs['is_negative_anomaly']
        self.is_positive_anomaly = kwargs['is_positive_anomaly']
        self.severity = kwargs.get('severity', None)


class Model(msrest.serialization.Model):
    """Response of getting a model.

    All required parameters must be populated in order to send to Azure.

    :ivar model_id: Required. Model identifier.
    :vartype model_id: str
    :ivar created_time: Required. Date and time (UTC) when the model was created.
    :vartype created_time: ~datetime.datetime
    :ivar last_updated_time: Required. Date and time (UTC) when the model was last updated.
    :vartype last_updated_time: ~datetime.datetime
    :ivar model_info: Train result of a model including status, errors and diagnose info for model
     and variables.
    :vartype model_info: ~azure.ai.anomalydetector.models.ModelInfo
    """

    _validation = {
        'model_id': {'required': True},
        'created_time': {'required': True},
        'last_updated_time': {'required': True},
    }

    _attribute_map = {
        'model_id': {'key': 'modelId', 'type': 'str'},
        'created_time': {'key': 'createdTime', 'type': 'iso-8601'},
        'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'},
        'model_info': {'key': 'modelInfo', 'type': 'ModelInfo'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword model_id: Required. Model identifier.
        :paramtype model_id: str
        :keyword created_time: Required. Date and time (UTC) when the model was created.
        :paramtype created_time: ~datetime.datetime
        :keyword last_updated_time: Required. Date and time (UTC) when the model was last updated.
        :paramtype last_updated_time: ~datetime.datetime
        :keyword model_info: Train result of a model including status, errors and diagnose info for
         model and variables.
        :paramtype model_info: ~azure.ai.anomalydetector.models.ModelInfo
        """
        super(Model, self).__init__(**kwargs)
        self.model_id = kwargs['model_id']
        self.created_time = kwargs['created_time']
        self.last_updated_time = kwargs['last_updated_time']
        self.model_info = kwargs.get('model_info', None)


class ModelInfo(msrest.serialization.Model):
    """Train result of a model including status, errors and diagnose info for model and variables.

    Variables are only populated by the server, and will be ignored when sending a request.

    All required parameters must be populated in order to send to Azure.

    :ivar sliding_window: An optional field, indicating how many previous points will be used to
     compute the anomaly score of the subsequent point.
    :vartype sliding_window: int
    :ivar align_policy:
    :vartype align_policy: ~azure.ai.anomalydetector.models.AlignPolicy
    :ivar source: Required. Source link to the input variables. Each variable should be a csv file
     with two columns, ``timestamp`` and ``value``. By default, the file name of the variable will
     be used as its variable name.
    :vartype source: str
    :ivar start_time: Required. A required field, indicating the start time of training data.
     Should be date-time.
    :vartype start_time: ~datetime.datetime
    :ivar end_time: Required. A required field, indicating the end time of training data. Should be
     date-time.
    :vartype end_time: ~datetime.datetime
    :ivar display_name: An optional field. The name of the model whose maximum length is 24.
    :vartype display_name: str
    :ivar status: Model training status. Possible values include: "CREATED", "RUNNING", "READY",
     "FAILED".
    :vartype status: str or ~azure.ai.anomalydetector.models.ModelStatus
    :ivar errors: Error messages when failed to create a model.
    :vartype errors: list[~azure.ai.anomalydetector.models.ErrorResponse]
    :ivar diagnostics_info:
    :vartype diagnostics_info: ~azure.ai.anomalydetector.models.DiagnosticsInfo
    """

    _validation = {
        'source': {'required': True},
        'start_time': {'required': True},
        'end_time': {'required': True},
        'display_name': {'max_length': 24, 'min_length': 0},
        'status': {'readonly': True},
        'errors': {'readonly': True},
        'diagnostics_info': {'readonly': True},
    }

    _attribute_map = {
        'sliding_window': {'key': 'slidingWindow', 'type': 'int'},
        'align_policy': {'key': 'alignPolicy', 'type': 'AlignPolicy'},
        'source': {'key': 'source', 'type': 'str'},
        'start_time': {'key': 'startTime', 'type': 'iso-8601'},
        'end_time': {'key': 'endTime', 'type': 'iso-8601'},
        'display_name': {'key': 'displayName', 'type': 'str'},
        'status': {'key': 'status', 'type': 'str'},
        'errors': {'key': 'errors', 'type': '[ErrorResponse]'},
        'diagnostics_info': {'key': 'diagnosticsInfo', 'type': 'DiagnosticsInfo'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword sliding_window: An optional field, indicating how many previous points will be used to
         compute the anomaly score of the subsequent point.
        :paramtype sliding_window: int
        :keyword align_policy:
        :paramtype align_policy: ~azure.ai.anomalydetector.models.AlignPolicy
        :keyword source: Required. Source link to the input variables. Each variable should be a csv
         file with two columns, ``timestamp`` and ``value``. By default, the file name of the variable
         will be used as its variable name.
        :paramtype source: str
        :keyword start_time: Required. A required field, indicating the start time of training data.
         Should be date-time.
        :paramtype start_time: ~datetime.datetime
        :keyword end_time: Required. A required field, indicating the end time of training data. Should
         be date-time.
        :paramtype end_time: ~datetime.datetime
        :keyword display_name: An optional field. The name of the model whose maximum length is 24.
        :paramtype display_name: str
        """
        super(ModelInfo, self).__init__(**kwargs)
        self.sliding_window = kwargs.get('sliding_window', None)
        self.align_policy = kwargs.get('align_policy', None)
        self.source = kwargs['source']
        self.start_time = kwargs['start_time']
        self.end_time = kwargs['end_time']
        self.display_name = kwargs.get('display_name', None)
        self.status = None
        self.errors = None
        self.diagnostics_info = None


class ModelList(msrest.serialization.Model):
    """Response of listing models.

    All required parameters must be populated in order to send to Azure.

    :ivar models: Required. List of models.
    :vartype models: list[~azure.ai.anomalydetector.models.ModelSnapshot]
    :ivar current_count: Required. Current count of trained multivariate models.
    :vartype current_count: int
    :ivar max_count: Required. Max number of models that can be trained for this subscription.
    :vartype max_count: int
    :ivar next_link: The link to fetch more models.
    :vartype next_link: str
    """

    _validation = {
        'models': {'required': True},
        'current_count': {'required': True},
        'max_count': {'required': True},
    }

    _attribute_map = {
        'models': {'key': 'models', 'type': '[ModelSnapshot]'},
        'current_count': {'key': 'currentCount', 'type': 'int'},
        'max_count': {'key': 'maxCount', 'type': 'int'},
        'next_link': {'key': 'nextLink', 'type': 'str'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword models: Required. List of models.
        :paramtype models: list[~azure.ai.anomalydetector.models.ModelSnapshot]
        :keyword current_count: Required. Current count of trained multivariate models.
        :paramtype current_count: int
        :keyword max_count: Required. Max number of models that can be trained for this subscription.
        :paramtype max_count: int
        :keyword next_link: The link to fetch more models.
        :paramtype next_link: str
        """
        super(ModelList, self).__init__(**kwargs)
        self.models = kwargs['models']
        self.current_count = kwargs['current_count']
        self.max_count = kwargs['max_count']
        self.next_link = kwargs.get('next_link', None)


class ModelSnapshot(msrest.serialization.Model):
    """ModelSnapshot.

    Variables are only populated by the server, and will be ignored when sending a request.

    All required parameters must be populated in order to send to Azure.

    :ivar model_id: Required. Model identifier.
    :vartype model_id: str
    :ivar created_time: Required. Date and time (UTC) when the model was created.
    :vartype created_time: ~datetime.datetime
    :ivar last_updated_time: Required. Date and time (UTC) when the model was last updated.
    :vartype last_updated_time: ~datetime.datetime
    :ivar status: Required. Model training status. Possible values include: "CREATED", "RUNNING",
     "READY", "FAILED".
    :vartype status: str or ~azure.ai.anomalydetector.models.ModelStatus
    :ivar display_name:
    :vartype display_name: str
    :ivar variables_count: Required. Total number of variables.
    :vartype variables_count: int
    """

    _validation = {
        'model_id': {'required': True},
        'created_time': {'required': True},
        'last_updated_time': {'required': True},
        'status': {'required': True, 'readonly': True},
        'variables_count': {'required': True},
    }

    _attribute_map = {
        'model_id': {'key': 'modelId', 'type': 'str'},
        'created_time': {'key': 'createdTime', 'type': 'iso-8601'},
        'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'},
        'status': {'key': 'status', 'type': 'str'},
        'display_name': {'key': 'displayName', 'type': 'str'},
        'variables_count': {'key': 'variablesCount', 'type': 'int'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword model_id: Required. Model identifier.
        :paramtype model_id: str
        :keyword created_time: Required. Date and time (UTC) when the model was created.
        :paramtype created_time: ~datetime.datetime
        :keyword last_updated_time: Required. Date and time (UTC) when the model was last updated.
        :paramtype last_updated_time: ~datetime.datetime
        :keyword display_name:
        :paramtype display_name: str
        :keyword variables_count: Required. Total number of variables.
        :paramtype variables_count: int
        """
        super(ModelSnapshot, self).__init__(**kwargs)
        self.model_id = kwargs['model_id']
        self.created_time = kwargs['created_time']
        self.last_updated_time = kwargs['last_updated_time']
        self.status = None
        self.display_name = kwargs.get('display_name', None)
        self.variables_count = kwargs['variables_count']


class ModelState(msrest.serialization.Model):
    """ModelState.

    :ivar epoch_ids: Epoch id.
    :vartype epoch_ids: list[int]
    :ivar train_losses:
    :vartype train_losses: list[float]
    :ivar validation_losses:
    :vartype validation_losses: list[float]
    :ivar latencies_in_seconds:
    :vartype latencies_in_seconds: list[float]
    """

    _attribute_map = {
        'epoch_ids': {'key': 'epochIds', 'type': '[int]'},
        'train_losses': {'key': 'trainLosses', 'type': '[float]'},
        'validation_losses': {'key': 'validationLosses', 'type': '[float]'},
        'latencies_in_seconds': {'key': 'latenciesInSeconds', 'type': '[float]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword epoch_ids: Epoch id.
        :paramtype epoch_ids: list[int]
        :keyword train_losses:
        :paramtype train_losses: list[float]
        :keyword validation_losses:
        :paramtype validation_losses: list[float]
        :keyword latencies_in_seconds:
        :paramtype latencies_in_seconds: list[float]
        """
        super(ModelState, self).__init__(**kwargs)
        self.epoch_ids = kwargs.get('epoch_ids', None)
        self.train_losses = kwargs.get('train_losses', None)
        self.validation_losses = kwargs.get('validation_losses', None)
        self.latencies_in_seconds = kwargs.get('latencies_in_seconds', None)


class TimeSeriesPoint(msrest.serialization.Model):
    """The definition of input timeseries points.

    All required parameters must be populated in order to send to Azure.

    :ivar timestamp: Optional argument, timestamp of a data point (ISO8601 format).
    :vartype timestamp: ~datetime.datetime
    :ivar value: Required. The measurement of that point, should be float.
    :vartype value: float
    """

    _validation = {
        'value': {'required': True},
    }

    _attribute_map = {
        'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
        'value': {'key': 'value', 'type': 'float'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword timestamp: Optional argument, timestamp of a data point (ISO8601 format).
        :paramtype timestamp: ~datetime.datetime
        :keyword value: Required. The measurement of that point, should be float.
        :paramtype value: float
        """
        super(TimeSeriesPoint, self).__init__(**kwargs)
        self.timestamp = kwargs.get('timestamp', None)
        self.value = kwargs['value']


class VariableState(msrest.serialization.Model):
    """VariableState.

    :ivar variable: Variable name.
    :vartype variable: str
    :ivar filled_na_ratio: Proportion of NaN values filled of the variable.
    :vartype filled_na_ratio: float
    :ivar effective_count: Number of effective points counted.
    :vartype effective_count: int
    :ivar start_time: Start time of the variable.
    :vartype start_time: ~datetime.datetime
    :ivar end_time: End time of the variable.
    :vartype end_time: ~datetime.datetime
    """

    _validation = {
        'filled_na_ratio': {'maximum': 1, 'minimum': 0},
    }

    _attribute_map = {
        'variable': {'key': 'variable', 'type': 'str'},
        'filled_na_ratio': {'key': 'filledNARatio', 'type': 'float'},
        'effective_count': {'key': 'effectiveCount', 'type': 'int'},
        'start_time': {'key': 'startTime', 'type': 'iso-8601'},
        'end_time': {'key': 'endTime', 'type': 'iso-8601'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword variable: Variable name.
        :paramtype variable: str
        :keyword filled_na_ratio: Proportion of NaN values filled of the variable.
        :paramtype filled_na_ratio: float
        :keyword effective_count: Number of effective points counted.
        :paramtype effective_count: int
        :keyword start_time: Start time of the variable.
        :paramtype start_time: ~datetime.datetime
        :keyword end_time: End time of the variable.
        :paramtype end_time: ~datetime.datetime
        """
        super(VariableState, self).__init__(**kwargs)
        self.variable = kwargs.get('variable', None)
        self.filled_na_ratio = kwargs.get('filled_na_ratio', None)
        self.effective_count = kwargs.get('effective_count', None)
        self.start_time = kwargs.get('start_time', None)
        self.end_time = kwargs.get('end_time', None)


class VariableValues(msrest.serialization.Model):
    """VariableValues.

    All required parameters must be populated in order to send to Azure.

    :ivar name: Required. variable name.
    :vartype name: str
    :ivar timestamps: Required. timestamps.
    :vartype timestamps: list[str]
    :ivar values: Required. values.
    :vartype values: list[float]
    """

    _validation = {
        'name': {'required': True},
        'timestamps': {'required': True},
        'values': {'required': True},
    }

    _attribute_map = {
        'name': {'key': 'name', 'type': 'str'},
        'timestamps': {'key': 'timestamps', 'type': '[str]'},
        'values': {'key': 'values', 'type': '[float]'},
    }

    def __init__(
        self,
        **kwargs
    ):
        """
        :keyword name: Required. variable name.
        :paramtype name: str
        :keyword timestamps: Required. timestamps.
        :paramtype timestamps: list[str]
        :keyword values: Required. values.
        :paramtype values: list[float]
        """
        super(VariableValues, self).__init__(**kwargs)
        self.name = kwargs['name']
        self.timestamps = kwargs['timestamps']
        self.values = kwargs['values']
