{-# 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.IoTFleetWise.Types.ModelManifestSummary
-- 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.IoTFleetWise.Types.ModelManifestSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTFleetWise.Types.ManifestStatus
import qualified Amazonka.Prelude as Prelude

-- | Information about a vehicle model (model manifest). You can use the API
-- operation to return this information about multiple vehicle models.
--
-- /See:/ 'newModelManifestSummary' smart constructor.
data ModelManifestSummary = ModelManifestSummary'
  { -- | The Amazon Resource Name (ARN) of the vehicle model.
    ModelManifestSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | A brief description of the vehicle model.
    ModelManifestSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the vehicle model.
    ModelManifestSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the signal catalog associated with the vehicle model.
    ModelManifestSummary -> Maybe Text
signalCatalogArn :: Prelude.Maybe Prelude.Text,
    -- | The state of the vehicle model. If the status is @ACTIVE@, the vehicle
    -- model can\'t be edited. If the status is @DRAFT@, you can edit the
    -- vehicle model.
    ModelManifestSummary -> Maybe ManifestStatus
status :: Prelude.Maybe ManifestStatus,
    -- | The time the vehicle model was created, in seconds since epoch (January
    -- 1, 1970 at midnight UTC time).
    ModelManifestSummary -> POSIX
creationTime :: Data.POSIX,
    -- | The time the vehicle model was last updated, in seconds since epoch
    -- (January 1, 1970 at midnight UTC time).
    ModelManifestSummary -> POSIX
lastModificationTime :: Data.POSIX
  }
  deriving (ModelManifestSummary -> ModelManifestSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelManifestSummary -> ModelManifestSummary -> Bool
$c/= :: ModelManifestSummary -> ModelManifestSummary -> Bool
== :: ModelManifestSummary -> ModelManifestSummary -> Bool
$c== :: ModelManifestSummary -> ModelManifestSummary -> Bool
Prelude.Eq, ReadPrec [ModelManifestSummary]
ReadPrec ModelManifestSummary
Int -> ReadS ModelManifestSummary
ReadS [ModelManifestSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelManifestSummary]
$creadListPrec :: ReadPrec [ModelManifestSummary]
readPrec :: ReadPrec ModelManifestSummary
$creadPrec :: ReadPrec ModelManifestSummary
readList :: ReadS [ModelManifestSummary]
$creadList :: ReadS [ModelManifestSummary]
readsPrec :: Int -> ReadS ModelManifestSummary
$creadsPrec :: Int -> ReadS ModelManifestSummary
Prelude.Read, Int -> ModelManifestSummary -> ShowS
[ModelManifestSummary] -> ShowS
ModelManifestSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelManifestSummary] -> ShowS
$cshowList :: [ModelManifestSummary] -> ShowS
show :: ModelManifestSummary -> String
$cshow :: ModelManifestSummary -> String
showsPrec :: Int -> ModelManifestSummary -> ShowS
$cshowsPrec :: Int -> ModelManifestSummary -> ShowS
Prelude.Show, forall x. Rep ModelManifestSummary x -> ModelManifestSummary
forall x. ModelManifestSummary -> Rep ModelManifestSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelManifestSummary x -> ModelManifestSummary
$cfrom :: forall x. ModelManifestSummary -> Rep ModelManifestSummary x
Prelude.Generic)

-- |
-- Create a value of 'ModelManifestSummary' 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:
--
-- 'arn', 'modelManifestSummary_arn' - The Amazon Resource Name (ARN) of the vehicle model.
--
-- 'description', 'modelManifestSummary_description' - A brief description of the vehicle model.
--
-- 'name', 'modelManifestSummary_name' - The name of the vehicle model.
--
-- 'signalCatalogArn', 'modelManifestSummary_signalCatalogArn' - The ARN of the signal catalog associated with the vehicle model.
--
-- 'status', 'modelManifestSummary_status' - The state of the vehicle model. If the status is @ACTIVE@, the vehicle
-- model can\'t be edited. If the status is @DRAFT@, you can edit the
-- vehicle model.
--
-- 'creationTime', 'modelManifestSummary_creationTime' - The time the vehicle model was created, in seconds since epoch (January
-- 1, 1970 at midnight UTC time).
--
-- 'lastModificationTime', 'modelManifestSummary_lastModificationTime' - The time the vehicle model was last updated, in seconds since epoch
-- (January 1, 1970 at midnight UTC time).
newModelManifestSummary ::
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'lastModificationTime'
  Prelude.UTCTime ->
  ModelManifestSummary
newModelManifestSummary :: UTCTime -> UTCTime -> ModelManifestSummary
newModelManifestSummary
  UTCTime
pCreationTime_
  UTCTime
pLastModificationTime_ =
    ModelManifestSummary'
      { $sel:arn:ModelManifestSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
        $sel:description:ModelManifestSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:name:ModelManifestSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
        $sel:signalCatalogArn:ModelManifestSummary' :: Maybe Text
signalCatalogArn = forall a. Maybe a
Prelude.Nothing,
        $sel:status:ModelManifestSummary' :: Maybe ManifestStatus
status = forall a. Maybe a
Prelude.Nothing,
        $sel:creationTime:ModelManifestSummary' :: POSIX
creationTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:lastModificationTime:ModelManifestSummary' :: POSIX
lastModificationTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModificationTime_
      }

-- | The Amazon Resource Name (ARN) of the vehicle model.
modelManifestSummary_arn :: Lens.Lens' ModelManifestSummary (Prelude.Maybe Prelude.Text)
modelManifestSummary_arn :: Lens' ModelManifestSummary (Maybe Text)
modelManifestSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelManifestSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ModelManifestSummary
s@ModelManifestSummary' {} Maybe Text
a -> ModelManifestSummary
s {$sel:arn:ModelManifestSummary' :: Maybe Text
arn = Maybe Text
a} :: ModelManifestSummary)

-- | A brief description of the vehicle model.
modelManifestSummary_description :: Lens.Lens' ModelManifestSummary (Prelude.Maybe Prelude.Text)
modelManifestSummary_description :: Lens' ModelManifestSummary (Maybe Text)
modelManifestSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelManifestSummary' {Maybe Text
description :: Maybe Text
$sel:description:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: ModelManifestSummary
s@ModelManifestSummary' {} Maybe Text
a -> ModelManifestSummary
s {$sel:description:ModelManifestSummary' :: Maybe Text
description = Maybe Text
a} :: ModelManifestSummary)

-- | The name of the vehicle model.
modelManifestSummary_name :: Lens.Lens' ModelManifestSummary (Prelude.Maybe Prelude.Text)
modelManifestSummary_name :: Lens' ModelManifestSummary (Maybe Text)
modelManifestSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelManifestSummary' {Maybe Text
name :: Maybe Text
$sel:name:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ModelManifestSummary
s@ModelManifestSummary' {} Maybe Text
a -> ModelManifestSummary
s {$sel:name:ModelManifestSummary' :: Maybe Text
name = Maybe Text
a} :: ModelManifestSummary)

-- | The ARN of the signal catalog associated with the vehicle model.
modelManifestSummary_signalCatalogArn :: Lens.Lens' ModelManifestSummary (Prelude.Maybe Prelude.Text)
modelManifestSummary_signalCatalogArn :: Lens' ModelManifestSummary (Maybe Text)
modelManifestSummary_signalCatalogArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelManifestSummary' {Maybe Text
signalCatalogArn :: Maybe Text
$sel:signalCatalogArn:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
signalCatalogArn} -> Maybe Text
signalCatalogArn) (\s :: ModelManifestSummary
s@ModelManifestSummary' {} Maybe Text
a -> ModelManifestSummary
s {$sel:signalCatalogArn:ModelManifestSummary' :: Maybe Text
signalCatalogArn = Maybe Text
a} :: ModelManifestSummary)

-- | The state of the vehicle model. If the status is @ACTIVE@, the vehicle
-- model can\'t be edited. If the status is @DRAFT@, you can edit the
-- vehicle model.
modelManifestSummary_status :: Lens.Lens' ModelManifestSummary (Prelude.Maybe ManifestStatus)
modelManifestSummary_status :: Lens' ModelManifestSummary (Maybe ManifestStatus)
modelManifestSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelManifestSummary' {Maybe ManifestStatus
status :: Maybe ManifestStatus
$sel:status:ModelManifestSummary' :: ModelManifestSummary -> Maybe ManifestStatus
status} -> Maybe ManifestStatus
status) (\s :: ModelManifestSummary
s@ModelManifestSummary' {} Maybe ManifestStatus
a -> ModelManifestSummary
s {$sel:status:ModelManifestSummary' :: Maybe ManifestStatus
status = Maybe ManifestStatus
a} :: ModelManifestSummary)

-- | The time the vehicle model was created, in seconds since epoch (January
-- 1, 1970 at midnight UTC time).
modelManifestSummary_creationTime :: Lens.Lens' ModelManifestSummary Prelude.UTCTime
modelManifestSummary_creationTime :: Lens' ModelManifestSummary UTCTime
modelManifestSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelManifestSummary' {POSIX
creationTime :: POSIX
$sel:creationTime:ModelManifestSummary' :: ModelManifestSummary -> POSIX
creationTime} -> POSIX
creationTime) (\s :: ModelManifestSummary
s@ModelManifestSummary' {} POSIX
a -> ModelManifestSummary
s {$sel:creationTime:ModelManifestSummary' :: POSIX
creationTime = POSIX
a} :: ModelManifestSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The time the vehicle model was last updated, in seconds since epoch
-- (January 1, 1970 at midnight UTC time).
modelManifestSummary_lastModificationTime :: Lens.Lens' ModelManifestSummary Prelude.UTCTime
modelManifestSummary_lastModificationTime :: Lens' ModelManifestSummary UTCTime
modelManifestSummary_lastModificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelManifestSummary' {POSIX
lastModificationTime :: POSIX
$sel:lastModificationTime:ModelManifestSummary' :: ModelManifestSummary -> POSIX
lastModificationTime} -> POSIX
lastModificationTime) (\s :: ModelManifestSummary
s@ModelManifestSummary' {} POSIX
a -> ModelManifestSummary
s {$sel:lastModificationTime:ModelManifestSummary' :: POSIX
lastModificationTime = POSIX
a} :: ModelManifestSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON ModelManifestSummary where
  parseJSON :: Value -> Parser ModelManifestSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ModelManifestSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ManifestStatus
-> POSIX
-> POSIX
-> ModelManifestSummary
ModelManifestSummary'
            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
"arn")
            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
"name")
            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
"signalCatalogArn")
            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
"creationTime")
            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
"lastModificationTime")
      )

instance Prelude.Hashable ModelManifestSummary where
  hashWithSalt :: Int -> ModelManifestSummary -> Int
hashWithSalt Int
_salt ModelManifestSummary' {Maybe Text
Maybe ManifestStatus
POSIX
lastModificationTime :: POSIX
creationTime :: POSIX
status :: Maybe ManifestStatus
signalCatalogArn :: Maybe Text
name :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:lastModificationTime:ModelManifestSummary' :: ModelManifestSummary -> POSIX
$sel:creationTime:ModelManifestSummary' :: ModelManifestSummary -> POSIX
$sel:status:ModelManifestSummary' :: ModelManifestSummary -> Maybe ManifestStatus
$sel:signalCatalogArn:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
$sel:name:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
$sel:description:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
$sel:arn:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
signalCatalogArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ManifestStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastModificationTime

instance Prelude.NFData ModelManifestSummary where
  rnf :: ModelManifestSummary -> ()
rnf ModelManifestSummary' {Maybe Text
Maybe ManifestStatus
POSIX
lastModificationTime :: POSIX
creationTime :: POSIX
status :: Maybe ManifestStatus
signalCatalogArn :: Maybe Text
name :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:lastModificationTime:ModelManifestSummary' :: ModelManifestSummary -> POSIX
$sel:creationTime:ModelManifestSummary' :: ModelManifestSummary -> POSIX
$sel:status:ModelManifestSummary' :: ModelManifestSummary -> Maybe ManifestStatus
$sel:signalCatalogArn:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
$sel:name:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
$sel:description:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
$sel:arn:ModelManifestSummary' :: ModelManifestSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      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 Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
signalCatalogArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ManifestStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastModificationTime