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

module Azure::CognitiveServices::AnomalyDetector::V1_0
  module Models
    #
    # Model object.
    #
    #
    class LastDetectResponse

      include MsRestAzure

      # @return [Integer] Frequency extracted from the series, zero means no
      # recurrent pattern has been found.
      attr_accessor :period

      # @return [Integer] Suggested input series points needed for detecting
      # the latest point.
      attr_accessor :suggested_window

      # @return [Float] Expected value of the latest point.
      attr_accessor :expected_value

      # @return [Float] 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.
      attr_accessor :upper_margin

      # @return [Float] Lower margin of the latest point. LowerMargin is used
      # to calculate lowerBoundary, which equals to expectedValue - (100 -
      # marginScale)*lowerMargin.
      attr_accessor :lower_margin

      # @return [Boolean] Anomaly status of the latest point, true means the
      # latest point is an anomaly either in negative direction or positive
      # direction.
      attr_accessor :is_anomaly

      # @return [Boolean] 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.
      attr_accessor :is_negative_anomaly

      # @return [Boolean] 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.
      attr_accessor :is_positive_anomaly


      #
      # Mapper for LastDetectResponse class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'LastDetectResponse',
          type: {
            name: 'Composite',
            class_name: 'LastDetectResponse',
            model_properties: {
              period: {
                client_side_validation: true,
                required: true,
                serialized_name: 'period',
                type: {
                  name: 'Number'
                }
              },
              suggested_window: {
                client_side_validation: true,
                required: true,
                serialized_name: 'suggestedWindow',
                type: {
                  name: 'Number'
                }
              },
              expected_value: {
                client_side_validation: true,
                required: true,
                serialized_name: 'expectedValue',
                type: {
                  name: 'Double'
                }
              },
              upper_margin: {
                client_side_validation: true,
                required: true,
                serialized_name: 'upperMargin',
                type: {
                  name: 'Double'
                }
              },
              lower_margin: {
                client_side_validation: true,
                required: true,
                serialized_name: 'lowerMargin',
                type: {
                  name: 'Double'
                }
              },
              is_anomaly: {
                client_side_validation: true,
                required: true,
                serialized_name: 'isAnomaly',
                type: {
                  name: 'Boolean'
                }
              },
              is_negative_anomaly: {
                client_side_validation: true,
                required: true,
                serialized_name: 'isNegativeAnomaly',
                type: {
                  name: 'Boolean'
                }
              },
              is_positive_anomaly: {
                client_side_validation: true,
                required: true,
                serialized_name: 'isPositiveAnomaly',
                type: {
                  name: 'Boolean'
                }
              }
            }
          }
        }
      end
    end
  end
end
