{-# 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.LabelSummary
-- 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.LabelSummary 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.LabelRating
import qualified Amazonka.Prelude as Prelude

-- | Information about the label.
--
-- /See:/ 'newLabelSummary' smart constructor.
data LabelSummary = LabelSummary'
  { -- | The time at which the label was created.
    LabelSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | The timestamp indicating the end of the label.
    LabelSummary -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
    -- | Indicates that a label pertains to a particular piece of equipment.
    LabelSummary -> Maybe Text
equipment :: Prelude.Maybe Prelude.Text,
    -- | Indicates the type of anomaly associated with the label.
    --
    -- Data in this field will be retained for service usage. Follow best
    -- practices for the security of your data.
    LabelSummary -> Maybe Text
faultCode :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the label group.
    LabelSummary -> Maybe Text
labelGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the label group.
    LabelSummary -> Maybe Text
labelGroupName :: Prelude.Maybe Prelude.Text,
    -- | The ID of the label.
    LabelSummary -> Maybe Text
labelId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether a labeled event represents an anomaly.
    LabelSummary -> Maybe LabelRating
rating :: Prelude.Maybe LabelRating,
    -- | The timestamp indicating the start of the label.
    LabelSummary -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX
  }
  deriving (LabelSummary -> LabelSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelSummary -> LabelSummary -> Bool
$c/= :: LabelSummary -> LabelSummary -> Bool
== :: LabelSummary -> LabelSummary -> Bool
$c== :: LabelSummary -> LabelSummary -> Bool
Prelude.Eq, ReadPrec [LabelSummary]
ReadPrec LabelSummary
Int -> ReadS LabelSummary
ReadS [LabelSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelSummary]
$creadListPrec :: ReadPrec [LabelSummary]
readPrec :: ReadPrec LabelSummary
$creadPrec :: ReadPrec LabelSummary
readList :: ReadS [LabelSummary]
$creadList :: ReadS [LabelSummary]
readsPrec :: Int -> ReadS LabelSummary
$creadsPrec :: Int -> ReadS LabelSummary
Prelude.Read, Int -> LabelSummary -> ShowS
[LabelSummary] -> ShowS
LabelSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelSummary] -> ShowS
$cshowList :: [LabelSummary] -> ShowS
show :: LabelSummary -> String
$cshow :: LabelSummary -> String
showsPrec :: Int -> LabelSummary -> ShowS
$cshowsPrec :: Int -> LabelSummary -> ShowS
Prelude.Show, forall x. Rep LabelSummary x -> LabelSummary
forall x. LabelSummary -> Rep LabelSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LabelSummary x -> LabelSummary
$cfrom :: forall x. LabelSummary -> Rep LabelSummary x
Prelude.Generic)

-- |
-- Create a value of 'LabelSummary' 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:
--
-- 'createdAt', 'labelSummary_createdAt' - The time at which the label was created.
--
-- 'endTime', 'labelSummary_endTime' - The timestamp indicating the end of the label.
--
-- 'equipment', 'labelSummary_equipment' - Indicates that a label pertains to a particular piece of equipment.
--
-- 'faultCode', 'labelSummary_faultCode' - Indicates the type of anomaly associated with the label.
--
-- Data in this field will be retained for service usage. Follow best
-- practices for the security of your data.
--
-- 'labelGroupArn', 'labelSummary_labelGroupArn' - The ARN of the label group.
--
-- 'labelGroupName', 'labelSummary_labelGroupName' - The name of the label group.
--
-- 'labelId', 'labelSummary_labelId' - The ID of the label.
--
-- 'rating', 'labelSummary_rating' - Indicates whether a labeled event represents an anomaly.
--
-- 'startTime', 'labelSummary_startTime' - The timestamp indicating the start of the label.
newLabelSummary ::
  LabelSummary
newLabelSummary :: LabelSummary
newLabelSummary =
  LabelSummary'
    { $sel:createdAt:LabelSummary' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:LabelSummary' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
      $sel:equipment:LabelSummary' :: Maybe Text
equipment = forall a. Maybe a
Prelude.Nothing,
      $sel:faultCode:LabelSummary' :: Maybe Text
faultCode = forall a. Maybe a
Prelude.Nothing,
      $sel:labelGroupArn:LabelSummary' :: Maybe Text
labelGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:labelGroupName:LabelSummary' :: Maybe Text
labelGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:labelId:LabelSummary' :: Maybe Text
labelId = forall a. Maybe a
Prelude.Nothing,
      $sel:rating:LabelSummary' :: Maybe LabelRating
rating = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:LabelSummary' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing
    }

-- | The time at which the label was created.
labelSummary_createdAt :: Lens.Lens' LabelSummary (Prelude.Maybe Prelude.UTCTime)
labelSummary_createdAt :: Lens' LabelSummary (Maybe UTCTime)
labelSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:LabelSummary' :: LabelSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: LabelSummary
s@LabelSummary' {} Maybe POSIX
a -> LabelSummary
s {$sel:createdAt:LabelSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: LabelSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The timestamp indicating the end of the label.
labelSummary_endTime :: Lens.Lens' LabelSummary (Prelude.Maybe Prelude.UTCTime)
labelSummary_endTime :: Lens' LabelSummary (Maybe UTCTime)
labelSummary_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelSummary' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:LabelSummary' :: LabelSummary -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: LabelSummary
s@LabelSummary' {} Maybe POSIX
a -> LabelSummary
s {$sel:endTime:LabelSummary' :: Maybe POSIX
endTime = Maybe POSIX
a} :: LabelSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Indicates that a label pertains to a particular piece of equipment.
labelSummary_equipment :: Lens.Lens' LabelSummary (Prelude.Maybe Prelude.Text)
labelSummary_equipment :: Lens' LabelSummary (Maybe Text)
labelSummary_equipment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelSummary' {Maybe Text
equipment :: Maybe Text
$sel:equipment:LabelSummary' :: LabelSummary -> Maybe Text
equipment} -> Maybe Text
equipment) (\s :: LabelSummary
s@LabelSummary' {} Maybe Text
a -> LabelSummary
s {$sel:equipment:LabelSummary' :: Maybe Text
equipment = Maybe Text
a} :: LabelSummary)

-- | Indicates the type of anomaly associated with the label.
--
-- Data in this field will be retained for service usage. Follow best
-- practices for the security of your data.
labelSummary_faultCode :: Lens.Lens' LabelSummary (Prelude.Maybe Prelude.Text)
labelSummary_faultCode :: Lens' LabelSummary (Maybe Text)
labelSummary_faultCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelSummary' {Maybe Text
faultCode :: Maybe Text
$sel:faultCode:LabelSummary' :: LabelSummary -> Maybe Text
faultCode} -> Maybe Text
faultCode) (\s :: LabelSummary
s@LabelSummary' {} Maybe Text
a -> LabelSummary
s {$sel:faultCode:LabelSummary' :: Maybe Text
faultCode = Maybe Text
a} :: LabelSummary)

-- | The ARN of the label group.
labelSummary_labelGroupArn :: Lens.Lens' LabelSummary (Prelude.Maybe Prelude.Text)
labelSummary_labelGroupArn :: Lens' LabelSummary (Maybe Text)
labelSummary_labelGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelSummary' {Maybe Text
labelGroupArn :: Maybe Text
$sel:labelGroupArn:LabelSummary' :: LabelSummary -> Maybe Text
labelGroupArn} -> Maybe Text
labelGroupArn) (\s :: LabelSummary
s@LabelSummary' {} Maybe Text
a -> LabelSummary
s {$sel:labelGroupArn:LabelSummary' :: Maybe Text
labelGroupArn = Maybe Text
a} :: LabelSummary)

-- | The name of the label group.
labelSummary_labelGroupName :: Lens.Lens' LabelSummary (Prelude.Maybe Prelude.Text)
labelSummary_labelGroupName :: Lens' LabelSummary (Maybe Text)
labelSummary_labelGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelSummary' {Maybe Text
labelGroupName :: Maybe Text
$sel:labelGroupName:LabelSummary' :: LabelSummary -> Maybe Text
labelGroupName} -> Maybe Text
labelGroupName) (\s :: LabelSummary
s@LabelSummary' {} Maybe Text
a -> LabelSummary
s {$sel:labelGroupName:LabelSummary' :: Maybe Text
labelGroupName = Maybe Text
a} :: LabelSummary)

-- | The ID of the label.
labelSummary_labelId :: Lens.Lens' LabelSummary (Prelude.Maybe Prelude.Text)
labelSummary_labelId :: Lens' LabelSummary (Maybe Text)
labelSummary_labelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelSummary' {Maybe Text
labelId :: Maybe Text
$sel:labelId:LabelSummary' :: LabelSummary -> Maybe Text
labelId} -> Maybe Text
labelId) (\s :: LabelSummary
s@LabelSummary' {} Maybe Text
a -> LabelSummary
s {$sel:labelId:LabelSummary' :: Maybe Text
labelId = Maybe Text
a} :: LabelSummary)

-- | Indicates whether a labeled event represents an anomaly.
labelSummary_rating :: Lens.Lens' LabelSummary (Prelude.Maybe LabelRating)
labelSummary_rating :: Lens' LabelSummary (Maybe LabelRating)
labelSummary_rating = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelSummary' {Maybe LabelRating
rating :: Maybe LabelRating
$sel:rating:LabelSummary' :: LabelSummary -> Maybe LabelRating
rating} -> Maybe LabelRating
rating) (\s :: LabelSummary
s@LabelSummary' {} Maybe LabelRating
a -> LabelSummary
s {$sel:rating:LabelSummary' :: Maybe LabelRating
rating = Maybe LabelRating
a} :: LabelSummary)

-- | The timestamp indicating the start of the label.
labelSummary_startTime :: Lens.Lens' LabelSummary (Prelude.Maybe Prelude.UTCTime)
labelSummary_startTime :: Lens' LabelSummary (Maybe UTCTime)
labelSummary_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelSummary' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:LabelSummary' :: LabelSummary -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: LabelSummary
s@LabelSummary' {} Maybe POSIX
a -> LabelSummary
s {$sel:startTime:LabelSummary' :: Maybe POSIX
startTime = Maybe POSIX
a} :: LabelSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON LabelSummary where
  parseJSON :: Value -> Parser LabelSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LabelSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LabelRating
-> Maybe POSIX
-> LabelSummary
LabelSummary'
            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
"CreatedAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EndTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Equipment")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FaultCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LabelGroupArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LabelGroupName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LabelId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Rating")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StartTime")
      )

instance Prelude.Hashable LabelSummary where
  hashWithSalt :: Int -> LabelSummary -> Int
hashWithSalt Int
_salt LabelSummary' {Maybe Text
Maybe POSIX
Maybe LabelRating
startTime :: Maybe POSIX
rating :: Maybe LabelRating
labelId :: Maybe Text
labelGroupName :: Maybe Text
labelGroupArn :: Maybe Text
faultCode :: Maybe Text
equipment :: Maybe Text
endTime :: Maybe POSIX
createdAt :: Maybe POSIX
$sel:startTime:LabelSummary' :: LabelSummary -> Maybe POSIX
$sel:rating:LabelSummary' :: LabelSummary -> Maybe LabelRating
$sel:labelId:LabelSummary' :: LabelSummary -> Maybe Text
$sel:labelGroupName:LabelSummary' :: LabelSummary -> Maybe Text
$sel:labelGroupArn:LabelSummary' :: LabelSummary -> Maybe Text
$sel:faultCode:LabelSummary' :: LabelSummary -> Maybe Text
$sel:equipment:LabelSummary' :: LabelSummary -> Maybe Text
$sel:endTime:LabelSummary' :: LabelSummary -> Maybe POSIX
$sel:createdAt:LabelSummary' :: LabelSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
equipment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
faultCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
labelGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
labelGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
labelId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LabelRating
rating
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime

instance Prelude.NFData LabelSummary where
  rnf :: LabelSummary -> ()
rnf LabelSummary' {Maybe Text
Maybe POSIX
Maybe LabelRating
startTime :: Maybe POSIX
rating :: Maybe LabelRating
labelId :: Maybe Text
labelGroupName :: Maybe Text
labelGroupArn :: Maybe Text
faultCode :: Maybe Text
equipment :: Maybe Text
endTime :: Maybe POSIX
createdAt :: Maybe POSIX
$sel:startTime:LabelSummary' :: LabelSummary -> Maybe POSIX
$sel:rating:LabelSummary' :: LabelSummary -> Maybe LabelRating
$sel:labelId:LabelSummary' :: LabelSummary -> Maybe Text
$sel:labelGroupName:LabelSummary' :: LabelSummary -> Maybe Text
$sel:labelGroupArn:LabelSummary' :: LabelSummary -> Maybe Text
$sel:faultCode:LabelSummary' :: LabelSummary -> Maybe Text
$sel:equipment:LabelSummary' :: LabelSummary -> Maybe Text
$sel:endTime:LabelSummary' :: LabelSummary -> Maybe POSIX
$sel:createdAt:LabelSummary' :: LabelSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
equipment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
faultCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
labelGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
labelGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
labelId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LabelRating
rating
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime