{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LookoutEquipment.Types.MonotonicValues
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.LookoutEquipment.Types.MonotonicValues where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutEquipment.Types.Monotonicity
import Amazonka.LookoutEquipment.Types.StatisticalIssueStatus
import qualified Amazonka.Prelude as Prelude

-- | Entity that comprises information on monotonic values in the data.
--
-- /See:/ 'newMonotonicValues' smart constructor.
data MonotonicValues = MonotonicValues'
  { -- | Indicates the monotonicity of values. Can be INCREASING, DECREASING, or
    -- STATIC.
    MonotonicValues -> Maybe Monotonicity
monotonicity :: Prelude.Maybe Monotonicity,
    -- | Indicates whether there is a potential data issue related to having
    -- monotonic values.
    MonotonicValues -> StatisticalIssueStatus
status :: StatisticalIssueStatus
  }
  deriving (MonotonicValues -> MonotonicValues -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonotonicValues -> MonotonicValues -> Bool
$c/= :: MonotonicValues -> MonotonicValues -> Bool
== :: MonotonicValues -> MonotonicValues -> Bool
$c== :: MonotonicValues -> MonotonicValues -> Bool
Prelude.Eq, ReadPrec [MonotonicValues]
ReadPrec MonotonicValues
Int -> ReadS MonotonicValues
ReadS [MonotonicValues]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonotonicValues]
$creadListPrec :: ReadPrec [MonotonicValues]
readPrec :: ReadPrec MonotonicValues
$creadPrec :: ReadPrec MonotonicValues
readList :: ReadS [MonotonicValues]
$creadList :: ReadS [MonotonicValues]
readsPrec :: Int -> ReadS MonotonicValues
$creadsPrec :: Int -> ReadS MonotonicValues
Prelude.Read, Int -> MonotonicValues -> ShowS
[MonotonicValues] -> ShowS
MonotonicValues -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonotonicValues] -> ShowS
$cshowList :: [MonotonicValues] -> ShowS
show :: MonotonicValues -> String
$cshow :: MonotonicValues -> String
showsPrec :: Int -> MonotonicValues -> ShowS
$cshowsPrec :: Int -> MonotonicValues -> ShowS
Prelude.Show, forall x. Rep MonotonicValues x -> MonotonicValues
forall x. MonotonicValues -> Rep MonotonicValues x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonotonicValues x -> MonotonicValues
$cfrom :: forall x. MonotonicValues -> Rep MonotonicValues x
Prelude.Generic)

-- |
-- Create a value of 'MonotonicValues' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'monotonicity', 'monotonicValues_monotonicity' - Indicates the monotonicity of values. Can be INCREASING, DECREASING, or
-- STATIC.
--
-- 'status', 'monotonicValues_status' - Indicates whether there is a potential data issue related to having
-- monotonic values.
newMonotonicValues ::
  -- | 'status'
  StatisticalIssueStatus ->
  MonotonicValues
newMonotonicValues :: StatisticalIssueStatus -> MonotonicValues
newMonotonicValues StatisticalIssueStatus
pStatus_ =
  MonotonicValues'
    { $sel:monotonicity:MonotonicValues' :: Maybe Monotonicity
monotonicity = forall a. Maybe a
Prelude.Nothing,
      $sel:status:MonotonicValues' :: StatisticalIssueStatus
status = StatisticalIssueStatus
pStatus_
    }

-- | Indicates the monotonicity of values. Can be INCREASING, DECREASING, or
-- STATIC.
monotonicValues_monotonicity :: Lens.Lens' MonotonicValues (Prelude.Maybe Monotonicity)
monotonicValues_monotonicity :: Lens' MonotonicValues (Maybe Monotonicity)
monotonicValues_monotonicity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonotonicValues' {Maybe Monotonicity
monotonicity :: Maybe Monotonicity
$sel:monotonicity:MonotonicValues' :: MonotonicValues -> Maybe Monotonicity
monotonicity} -> Maybe Monotonicity
monotonicity) (\s :: MonotonicValues
s@MonotonicValues' {} Maybe Monotonicity
a -> MonotonicValues
s {$sel:monotonicity:MonotonicValues' :: Maybe Monotonicity
monotonicity = Maybe Monotonicity
a} :: MonotonicValues)

-- | Indicates whether there is a potential data issue related to having
-- monotonic values.
monotonicValues_status :: Lens.Lens' MonotonicValues StatisticalIssueStatus
monotonicValues_status :: Lens' MonotonicValues StatisticalIssueStatus
monotonicValues_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonotonicValues' {StatisticalIssueStatus
status :: StatisticalIssueStatus
$sel:status:MonotonicValues' :: MonotonicValues -> StatisticalIssueStatus
status} -> StatisticalIssueStatus
status) (\s :: MonotonicValues
s@MonotonicValues' {} StatisticalIssueStatus
a -> MonotonicValues
s {$sel:status:MonotonicValues' :: StatisticalIssueStatus
status = StatisticalIssueStatus
a} :: MonotonicValues)

instance Data.FromJSON MonotonicValues where
  parseJSON :: Value -> Parser MonotonicValues
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MonotonicValues"
      ( \Object
x ->
          Maybe Monotonicity -> StatisticalIssueStatus -> MonotonicValues
MonotonicValues'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Monotonicity")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Status")
      )

instance Prelude.Hashable MonotonicValues where
  hashWithSalt :: Int -> MonotonicValues -> Int
hashWithSalt Int
_salt MonotonicValues' {Maybe Monotonicity
StatisticalIssueStatus
status :: StatisticalIssueStatus
monotonicity :: Maybe Monotonicity
$sel:status:MonotonicValues' :: MonotonicValues -> StatisticalIssueStatus
$sel:monotonicity:MonotonicValues' :: MonotonicValues -> Maybe Monotonicity
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Monotonicity
monotonicity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StatisticalIssueStatus
status

instance Prelude.NFData MonotonicValues where
  rnf :: MonotonicValues -> ()
rnf MonotonicValues' {Maybe Monotonicity
StatisticalIssueStatus
status :: StatisticalIssueStatus
monotonicity :: Maybe Monotonicity
$sel:status:MonotonicValues' :: MonotonicValues -> StatisticalIssueStatus
$sel:monotonicity:MonotonicValues' :: MonotonicValues -> Maybe Monotonicity
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Monotonicity
monotonicity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StatisticalIssueStatus
status