{-# 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.LabelGroupSummary
-- 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.LabelGroupSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Contains information about the label group.
--
-- /See:/ 'newLabelGroupSummary' smart constructor.
data LabelGroupSummary = LabelGroupSummary'
  { -- | The time at which the label group was created.
    LabelGroupSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | The ARN of the label group.
    LabelGroupSummary -> Maybe Text
labelGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the label group.
    LabelGroupSummary -> Maybe Text
labelGroupName :: Prelude.Maybe Prelude.Text,
    -- | The time at which the label group was updated.
    LabelGroupSummary -> Maybe POSIX
updatedAt :: Prelude.Maybe Data.POSIX
  }
  deriving (LabelGroupSummary -> LabelGroupSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelGroupSummary -> LabelGroupSummary -> Bool
$c/= :: LabelGroupSummary -> LabelGroupSummary -> Bool
== :: LabelGroupSummary -> LabelGroupSummary -> Bool
$c== :: LabelGroupSummary -> LabelGroupSummary -> Bool
Prelude.Eq, ReadPrec [LabelGroupSummary]
ReadPrec LabelGroupSummary
Int -> ReadS LabelGroupSummary
ReadS [LabelGroupSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelGroupSummary]
$creadListPrec :: ReadPrec [LabelGroupSummary]
readPrec :: ReadPrec LabelGroupSummary
$creadPrec :: ReadPrec LabelGroupSummary
readList :: ReadS [LabelGroupSummary]
$creadList :: ReadS [LabelGroupSummary]
readsPrec :: Int -> ReadS LabelGroupSummary
$creadsPrec :: Int -> ReadS LabelGroupSummary
Prelude.Read, Int -> LabelGroupSummary -> ShowS
[LabelGroupSummary] -> ShowS
LabelGroupSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelGroupSummary] -> ShowS
$cshowList :: [LabelGroupSummary] -> ShowS
show :: LabelGroupSummary -> String
$cshow :: LabelGroupSummary -> String
showsPrec :: Int -> LabelGroupSummary -> ShowS
$cshowsPrec :: Int -> LabelGroupSummary -> ShowS
Prelude.Show, forall x. Rep LabelGroupSummary x -> LabelGroupSummary
forall x. LabelGroupSummary -> Rep LabelGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LabelGroupSummary x -> LabelGroupSummary
$cfrom :: forall x. LabelGroupSummary -> Rep LabelGroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'LabelGroupSummary' 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', 'labelGroupSummary_createdAt' - The time at which the label group was created.
--
-- 'labelGroupArn', 'labelGroupSummary_labelGroupArn' - The ARN of the label group.
--
-- 'labelGroupName', 'labelGroupSummary_labelGroupName' - The name of the label group.
--
-- 'updatedAt', 'labelGroupSummary_updatedAt' - The time at which the label group was updated.
newLabelGroupSummary ::
  LabelGroupSummary
newLabelGroupSummary :: LabelGroupSummary
newLabelGroupSummary =
  LabelGroupSummary'
    { $sel:createdAt:LabelGroupSummary' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:labelGroupArn:LabelGroupSummary' :: Maybe Text
labelGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:labelGroupName:LabelGroupSummary' :: Maybe Text
labelGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:LabelGroupSummary' :: Maybe POSIX
updatedAt = forall a. Maybe a
Prelude.Nothing
    }

-- | The time at which the label group was created.
labelGroupSummary_createdAt :: Lens.Lens' LabelGroupSummary (Prelude.Maybe Prelude.UTCTime)
labelGroupSummary_createdAt :: Lens' LabelGroupSummary (Maybe UTCTime)
labelGroupSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelGroupSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:LabelGroupSummary' :: LabelGroupSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: LabelGroupSummary
s@LabelGroupSummary' {} Maybe POSIX
a -> LabelGroupSummary
s {$sel:createdAt:LabelGroupSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: LabelGroupSummary) 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 ARN of the label group.
labelGroupSummary_labelGroupArn :: Lens.Lens' LabelGroupSummary (Prelude.Maybe Prelude.Text)
labelGroupSummary_labelGroupArn :: Lens' LabelGroupSummary (Maybe Text)
labelGroupSummary_labelGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelGroupSummary' {Maybe Text
labelGroupArn :: Maybe Text
$sel:labelGroupArn:LabelGroupSummary' :: LabelGroupSummary -> Maybe Text
labelGroupArn} -> Maybe Text
labelGroupArn) (\s :: LabelGroupSummary
s@LabelGroupSummary' {} Maybe Text
a -> LabelGroupSummary
s {$sel:labelGroupArn:LabelGroupSummary' :: Maybe Text
labelGroupArn = Maybe Text
a} :: LabelGroupSummary)

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

-- | The time at which the label group was updated.
labelGroupSummary_updatedAt :: Lens.Lens' LabelGroupSummary (Prelude.Maybe Prelude.UTCTime)
labelGroupSummary_updatedAt :: Lens' LabelGroupSummary (Maybe UTCTime)
labelGroupSummary_updatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelGroupSummary' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:LabelGroupSummary' :: LabelGroupSummary -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: LabelGroupSummary
s@LabelGroupSummary' {} Maybe POSIX
a -> LabelGroupSummary
s {$sel:updatedAt:LabelGroupSummary' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: LabelGroupSummary) 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 LabelGroupSummary where
  parseJSON :: Value -> Parser LabelGroupSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LabelGroupSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe POSIX -> LabelGroupSummary
LabelGroupSummary'
            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
"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
"UpdatedAt")
      )

instance Prelude.Hashable LabelGroupSummary where
  hashWithSalt :: Int -> LabelGroupSummary -> Int
hashWithSalt Int
_salt LabelGroupSummary' {Maybe Text
Maybe POSIX
updatedAt :: Maybe POSIX
labelGroupName :: Maybe Text
labelGroupArn :: Maybe Text
createdAt :: Maybe POSIX
$sel:updatedAt:LabelGroupSummary' :: LabelGroupSummary -> Maybe POSIX
$sel:labelGroupName:LabelGroupSummary' :: LabelGroupSummary -> Maybe Text
$sel:labelGroupArn:LabelGroupSummary' :: LabelGroupSummary -> Maybe Text
$sel:createdAt:LabelGroupSummary' :: LabelGroupSummary -> 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 Text
labelGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
labelGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
updatedAt

instance Prelude.NFData LabelGroupSummary where
  rnf :: LabelGroupSummary -> ()
rnf LabelGroupSummary' {Maybe Text
Maybe POSIX
updatedAt :: Maybe POSIX
labelGroupName :: Maybe Text
labelGroupArn :: Maybe Text
createdAt :: Maybe POSIX
$sel:updatedAt:LabelGroupSummary' :: LabelGroupSummary -> Maybe POSIX
$sel:labelGroupName:LabelGroupSummary' :: LabelGroupSummary -> Maybe Text
$sel:labelGroupArn:LabelGroupSummary' :: LabelGroupSummary -> Maybe Text
$sel:createdAt:LabelGroupSummary' :: LabelGroupSummary -> 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 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 POSIX
updatedAt