{-# 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.IotTwinMaker.Types.ComponentTypeSummary
-- 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.IotTwinMaker.Types.ComponentTypeSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IotTwinMaker.Types.Status
import qualified Amazonka.Prelude as Prelude

-- | An object that contains information about a component type.
--
-- /See:/ 'newComponentTypeSummary' smart constructor.
data ComponentTypeSummary = ComponentTypeSummary'
  { -- | The component type name.
    ComponentTypeSummary -> Maybe Text
componentTypeName :: Prelude.Maybe Prelude.Text,
    -- | The description of the component type.
    ComponentTypeSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The current status of the component type.
    ComponentTypeSummary -> Maybe Status
status :: Prelude.Maybe Status,
    -- | The ARN of the component type.
    ComponentTypeSummary -> Text
arn :: Prelude.Text,
    -- | The ID of the component type.
    ComponentTypeSummary -> Text
componentTypeId :: Prelude.Text,
    -- | The date and time when the component type was created.
    ComponentTypeSummary -> POSIX
creationDateTime :: Data.POSIX,
    -- | The date and time when the component type was last updated.
    ComponentTypeSummary -> POSIX
updateDateTime :: Data.POSIX
  }
  deriving (ComponentTypeSummary -> ComponentTypeSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentTypeSummary -> ComponentTypeSummary -> Bool
$c/= :: ComponentTypeSummary -> ComponentTypeSummary -> Bool
== :: ComponentTypeSummary -> ComponentTypeSummary -> Bool
$c== :: ComponentTypeSummary -> ComponentTypeSummary -> Bool
Prelude.Eq, ReadPrec [ComponentTypeSummary]
ReadPrec ComponentTypeSummary
Int -> ReadS ComponentTypeSummary
ReadS [ComponentTypeSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComponentTypeSummary]
$creadListPrec :: ReadPrec [ComponentTypeSummary]
readPrec :: ReadPrec ComponentTypeSummary
$creadPrec :: ReadPrec ComponentTypeSummary
readList :: ReadS [ComponentTypeSummary]
$creadList :: ReadS [ComponentTypeSummary]
readsPrec :: Int -> ReadS ComponentTypeSummary
$creadsPrec :: Int -> ReadS ComponentTypeSummary
Prelude.Read, Int -> ComponentTypeSummary -> ShowS
[ComponentTypeSummary] -> ShowS
ComponentTypeSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentTypeSummary] -> ShowS
$cshowList :: [ComponentTypeSummary] -> ShowS
show :: ComponentTypeSummary -> String
$cshow :: ComponentTypeSummary -> String
showsPrec :: Int -> ComponentTypeSummary -> ShowS
$cshowsPrec :: Int -> ComponentTypeSummary -> ShowS
Prelude.Show, forall x. Rep ComponentTypeSummary x -> ComponentTypeSummary
forall x. ComponentTypeSummary -> Rep ComponentTypeSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComponentTypeSummary x -> ComponentTypeSummary
$cfrom :: forall x. ComponentTypeSummary -> Rep ComponentTypeSummary x
Prelude.Generic)

-- |
-- Create a value of 'ComponentTypeSummary' 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:
--
-- 'componentTypeName', 'componentTypeSummary_componentTypeName' - The component type name.
--
-- 'description', 'componentTypeSummary_description' - The description of the component type.
--
-- 'status', 'componentTypeSummary_status' - The current status of the component type.
--
-- 'arn', 'componentTypeSummary_arn' - The ARN of the component type.
--
-- 'componentTypeId', 'componentTypeSummary_componentTypeId' - The ID of the component type.
--
-- 'creationDateTime', 'componentTypeSummary_creationDateTime' - The date and time when the component type was created.
--
-- 'updateDateTime', 'componentTypeSummary_updateDateTime' - The date and time when the component type was last updated.
newComponentTypeSummary ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'componentTypeId'
  Prelude.Text ->
  -- | 'creationDateTime'
  Prelude.UTCTime ->
  -- | 'updateDateTime'
  Prelude.UTCTime ->
  ComponentTypeSummary
newComponentTypeSummary :: Text -> Text -> UTCTime -> UTCTime -> ComponentTypeSummary
newComponentTypeSummary
  Text
pArn_
  Text
pComponentTypeId_
  UTCTime
pCreationDateTime_
  UTCTime
pUpdateDateTime_ =
    ComponentTypeSummary'
      { $sel:componentTypeName:ComponentTypeSummary' :: Maybe Text
componentTypeName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:description:ComponentTypeSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:status:ComponentTypeSummary' :: Maybe Status
status = forall a. Maybe a
Prelude.Nothing,
        $sel:arn:ComponentTypeSummary' :: Text
arn = Text
pArn_,
        $sel:componentTypeId:ComponentTypeSummary' :: Text
componentTypeId = Text
pComponentTypeId_,
        $sel:creationDateTime:ComponentTypeSummary' :: POSIX
creationDateTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDateTime_,
        $sel:updateDateTime:ComponentTypeSummary' :: POSIX
updateDateTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateDateTime_
      }

-- | The component type name.
componentTypeSummary_componentTypeName :: Lens.Lens' ComponentTypeSummary (Prelude.Maybe Prelude.Text)
componentTypeSummary_componentTypeName :: Lens' ComponentTypeSummary (Maybe Text)
componentTypeSummary_componentTypeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentTypeSummary' {Maybe Text
componentTypeName :: Maybe Text
$sel:componentTypeName:ComponentTypeSummary' :: ComponentTypeSummary -> Maybe Text
componentTypeName} -> Maybe Text
componentTypeName) (\s :: ComponentTypeSummary
s@ComponentTypeSummary' {} Maybe Text
a -> ComponentTypeSummary
s {$sel:componentTypeName:ComponentTypeSummary' :: Maybe Text
componentTypeName = Maybe Text
a} :: ComponentTypeSummary)

-- | The description of the component type.
componentTypeSummary_description :: Lens.Lens' ComponentTypeSummary (Prelude.Maybe Prelude.Text)
componentTypeSummary_description :: Lens' ComponentTypeSummary (Maybe Text)
componentTypeSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentTypeSummary' {Maybe Text
description :: Maybe Text
$sel:description:ComponentTypeSummary' :: ComponentTypeSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: ComponentTypeSummary
s@ComponentTypeSummary' {} Maybe Text
a -> ComponentTypeSummary
s {$sel:description:ComponentTypeSummary' :: Maybe Text
description = Maybe Text
a} :: ComponentTypeSummary)

-- | The current status of the component type.
componentTypeSummary_status :: Lens.Lens' ComponentTypeSummary (Prelude.Maybe Status)
componentTypeSummary_status :: Lens' ComponentTypeSummary (Maybe Status)
componentTypeSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentTypeSummary' {Maybe Status
status :: Maybe Status
$sel:status:ComponentTypeSummary' :: ComponentTypeSummary -> Maybe Status
status} -> Maybe Status
status) (\s :: ComponentTypeSummary
s@ComponentTypeSummary' {} Maybe Status
a -> ComponentTypeSummary
s {$sel:status:ComponentTypeSummary' :: Maybe Status
status = Maybe Status
a} :: ComponentTypeSummary)

-- | The ARN of the component type.
componentTypeSummary_arn :: Lens.Lens' ComponentTypeSummary Prelude.Text
componentTypeSummary_arn :: Lens' ComponentTypeSummary Text
componentTypeSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentTypeSummary' {Text
arn :: Text
$sel:arn:ComponentTypeSummary' :: ComponentTypeSummary -> Text
arn} -> Text
arn) (\s :: ComponentTypeSummary
s@ComponentTypeSummary' {} Text
a -> ComponentTypeSummary
s {$sel:arn:ComponentTypeSummary' :: Text
arn = Text
a} :: ComponentTypeSummary)

-- | The ID of the component type.
componentTypeSummary_componentTypeId :: Lens.Lens' ComponentTypeSummary Prelude.Text
componentTypeSummary_componentTypeId :: Lens' ComponentTypeSummary Text
componentTypeSummary_componentTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentTypeSummary' {Text
componentTypeId :: Text
$sel:componentTypeId:ComponentTypeSummary' :: ComponentTypeSummary -> Text
componentTypeId} -> Text
componentTypeId) (\s :: ComponentTypeSummary
s@ComponentTypeSummary' {} Text
a -> ComponentTypeSummary
s {$sel:componentTypeId:ComponentTypeSummary' :: Text
componentTypeId = Text
a} :: ComponentTypeSummary)

-- | The date and time when the component type was created.
componentTypeSummary_creationDateTime :: Lens.Lens' ComponentTypeSummary Prelude.UTCTime
componentTypeSummary_creationDateTime :: Lens' ComponentTypeSummary UTCTime
componentTypeSummary_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentTypeSummary' {POSIX
creationDateTime :: POSIX
$sel:creationDateTime:ComponentTypeSummary' :: ComponentTypeSummary -> POSIX
creationDateTime} -> POSIX
creationDateTime) (\s :: ComponentTypeSummary
s@ComponentTypeSummary' {} POSIX
a -> ComponentTypeSummary
s {$sel:creationDateTime:ComponentTypeSummary' :: POSIX
creationDateTime = POSIX
a} :: ComponentTypeSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The date and time when the component type was last updated.
componentTypeSummary_updateDateTime :: Lens.Lens' ComponentTypeSummary Prelude.UTCTime
componentTypeSummary_updateDateTime :: Lens' ComponentTypeSummary UTCTime
componentTypeSummary_updateDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentTypeSummary' {POSIX
updateDateTime :: POSIX
$sel:updateDateTime:ComponentTypeSummary' :: ComponentTypeSummary -> POSIX
updateDateTime} -> POSIX
updateDateTime) (\s :: ComponentTypeSummary
s@ComponentTypeSummary' {} POSIX
a -> ComponentTypeSummary
s {$sel:updateDateTime:ComponentTypeSummary' :: POSIX
updateDateTime = POSIX
a} :: ComponentTypeSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON ComponentTypeSummary where
  parseJSON :: Value -> Parser ComponentTypeSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ComponentTypeSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Status
-> Text
-> Text
-> POSIX
-> POSIX
-> ComponentTypeSummary
ComponentTypeSummary'
            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
"componentTypeName")
            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
"description")
            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
"status")
            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
"arn")
            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
"componentTypeId")
            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
"creationDateTime")
            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
"updateDateTime")
      )

instance Prelude.Hashable ComponentTypeSummary where
  hashWithSalt :: Int -> ComponentTypeSummary -> Int
hashWithSalt Int
_salt ComponentTypeSummary' {Maybe Text
Maybe Status
Text
POSIX
updateDateTime :: POSIX
creationDateTime :: POSIX
componentTypeId :: Text
arn :: Text
status :: Maybe Status
description :: Maybe Text
componentTypeName :: Maybe Text
$sel:updateDateTime:ComponentTypeSummary' :: ComponentTypeSummary -> POSIX
$sel:creationDateTime:ComponentTypeSummary' :: ComponentTypeSummary -> POSIX
$sel:componentTypeId:ComponentTypeSummary' :: ComponentTypeSummary -> Text
$sel:arn:ComponentTypeSummary' :: ComponentTypeSummary -> Text
$sel:status:ComponentTypeSummary' :: ComponentTypeSummary -> Maybe Status
$sel:description:ComponentTypeSummary' :: ComponentTypeSummary -> Maybe Text
$sel:componentTypeName:ComponentTypeSummary' :: ComponentTypeSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
componentTypeName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Status
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
componentTypeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
updateDateTime

instance Prelude.NFData ComponentTypeSummary where
  rnf :: ComponentTypeSummary -> ()
rnf ComponentTypeSummary' {Maybe Text
Maybe Status
Text
POSIX
updateDateTime :: POSIX
creationDateTime :: POSIX
componentTypeId :: Text
arn :: Text
status :: Maybe Status
description :: Maybe Text
componentTypeName :: Maybe Text
$sel:updateDateTime:ComponentTypeSummary' :: ComponentTypeSummary -> POSIX
$sel:creationDateTime:ComponentTypeSummary' :: ComponentTypeSummary -> POSIX
$sel:componentTypeId:ComponentTypeSummary' :: ComponentTypeSummary -> Text
$sel:arn:ComponentTypeSummary' :: ComponentTypeSummary -> Text
$sel:status:ComponentTypeSummary' :: ComponentTypeSummary -> Maybe Status
$sel:description:ComponentTypeSummary' :: ComponentTypeSummary -> Maybe Text
$sel:componentTypeName:ComponentTypeSummary' :: ComponentTypeSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
componentTypeName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Status
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
componentTypeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
updateDateTime