{-# 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.VehicleSummary
-- 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.VehicleSummary 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

-- | Information about a vehicle.
--
-- To return this information about vehicles in your account, you can use
-- the API operation.
--
-- /See:/ 'newVehicleSummary' smart constructor.
data VehicleSummary = VehicleSummary'
  { -- | The unique ID of the vehicle.
    VehicleSummary -> Text
vehicleName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the vehicle.
    VehicleSummary -> Text
arn :: Prelude.Text,
    -- | The ARN of a vehicle model (model manifest) associated with the vehicle.
    VehicleSummary -> Text
modelManifestArn :: Prelude.Text,
    -- | The ARN of a decoder manifest associated with the vehicle.
    VehicleSummary -> Text
decoderManifestArn :: Prelude.Text,
    -- | The time the vehicle was created in seconds since epoch (January 1, 1970
    -- at midnight UTC time).
    VehicleSummary -> POSIX
creationTime :: Data.POSIX,
    -- | The time the vehicle was last updated in seconds since epoch (January 1,
    -- 1970 at midnight UTC time).
    VehicleSummary -> POSIX
lastModificationTime :: Data.POSIX
  }
  deriving (VehicleSummary -> VehicleSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VehicleSummary -> VehicleSummary -> Bool
$c/= :: VehicleSummary -> VehicleSummary -> Bool
== :: VehicleSummary -> VehicleSummary -> Bool
$c== :: VehicleSummary -> VehicleSummary -> Bool
Prelude.Eq, ReadPrec [VehicleSummary]
ReadPrec VehicleSummary
Int -> ReadS VehicleSummary
ReadS [VehicleSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VehicleSummary]
$creadListPrec :: ReadPrec [VehicleSummary]
readPrec :: ReadPrec VehicleSummary
$creadPrec :: ReadPrec VehicleSummary
readList :: ReadS [VehicleSummary]
$creadList :: ReadS [VehicleSummary]
readsPrec :: Int -> ReadS VehicleSummary
$creadsPrec :: Int -> ReadS VehicleSummary
Prelude.Read, Int -> VehicleSummary -> ShowS
[VehicleSummary] -> ShowS
VehicleSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VehicleSummary] -> ShowS
$cshowList :: [VehicleSummary] -> ShowS
show :: VehicleSummary -> String
$cshow :: VehicleSummary -> String
showsPrec :: Int -> VehicleSummary -> ShowS
$cshowsPrec :: Int -> VehicleSummary -> ShowS
Prelude.Show, forall x. Rep VehicleSummary x -> VehicleSummary
forall x. VehicleSummary -> Rep VehicleSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VehicleSummary x -> VehicleSummary
$cfrom :: forall x. VehicleSummary -> Rep VehicleSummary x
Prelude.Generic)

-- |
-- Create a value of 'VehicleSummary' 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:
--
-- 'vehicleName', 'vehicleSummary_vehicleName' - The unique ID of the vehicle.
--
-- 'arn', 'vehicleSummary_arn' - The Amazon Resource Name (ARN) of the vehicle.
--
-- 'modelManifestArn', 'vehicleSummary_modelManifestArn' - The ARN of a vehicle model (model manifest) associated with the vehicle.
--
-- 'decoderManifestArn', 'vehicleSummary_decoderManifestArn' - The ARN of a decoder manifest associated with the vehicle.
--
-- 'creationTime', 'vehicleSummary_creationTime' - The time the vehicle was created in seconds since epoch (January 1, 1970
-- at midnight UTC time).
--
-- 'lastModificationTime', 'vehicleSummary_lastModificationTime' - The time the vehicle was last updated in seconds since epoch (January 1,
-- 1970 at midnight UTC time).
newVehicleSummary ::
  -- | 'vehicleName'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  -- | 'modelManifestArn'
  Prelude.Text ->
  -- | 'decoderManifestArn'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'lastModificationTime'
  Prelude.UTCTime ->
  VehicleSummary
newVehicleSummary :: Text
-> Text -> Text -> Text -> UTCTime -> UTCTime -> VehicleSummary
newVehicleSummary
  Text
pVehicleName_
  Text
pArn_
  Text
pModelManifestArn_
  Text
pDecoderManifestArn_
  UTCTime
pCreationTime_
  UTCTime
pLastModificationTime_ =
    VehicleSummary'
      { $sel:vehicleName:VehicleSummary' :: Text
vehicleName = Text
pVehicleName_,
        $sel:arn:VehicleSummary' :: Text
arn = Text
pArn_,
        $sel:modelManifestArn:VehicleSummary' :: Text
modelManifestArn = Text
pModelManifestArn_,
        $sel:decoderManifestArn:VehicleSummary' :: Text
decoderManifestArn = Text
pDecoderManifestArn_,
        $sel:creationTime:VehicleSummary' :: POSIX
creationTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:lastModificationTime:VehicleSummary' :: POSIX
lastModificationTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModificationTime_
      }

-- | The unique ID of the vehicle.
vehicleSummary_vehicleName :: Lens.Lens' VehicleSummary Prelude.Text
vehicleSummary_vehicleName :: Lens' VehicleSummary Text
vehicleSummary_vehicleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VehicleSummary' {Text
vehicleName :: Text
$sel:vehicleName:VehicleSummary' :: VehicleSummary -> Text
vehicleName} -> Text
vehicleName) (\s :: VehicleSummary
s@VehicleSummary' {} Text
a -> VehicleSummary
s {$sel:vehicleName:VehicleSummary' :: Text
vehicleName = Text
a} :: VehicleSummary)

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

-- | The ARN of a vehicle model (model manifest) associated with the vehicle.
vehicleSummary_modelManifestArn :: Lens.Lens' VehicleSummary Prelude.Text
vehicleSummary_modelManifestArn :: Lens' VehicleSummary Text
vehicleSummary_modelManifestArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VehicleSummary' {Text
modelManifestArn :: Text
$sel:modelManifestArn:VehicleSummary' :: VehicleSummary -> Text
modelManifestArn} -> Text
modelManifestArn) (\s :: VehicleSummary
s@VehicleSummary' {} Text
a -> VehicleSummary
s {$sel:modelManifestArn:VehicleSummary' :: Text
modelManifestArn = Text
a} :: VehicleSummary)

-- | The ARN of a decoder manifest associated with the vehicle.
vehicleSummary_decoderManifestArn :: Lens.Lens' VehicleSummary Prelude.Text
vehicleSummary_decoderManifestArn :: Lens' VehicleSummary Text
vehicleSummary_decoderManifestArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VehicleSummary' {Text
decoderManifestArn :: Text
$sel:decoderManifestArn:VehicleSummary' :: VehicleSummary -> Text
decoderManifestArn} -> Text
decoderManifestArn) (\s :: VehicleSummary
s@VehicleSummary' {} Text
a -> VehicleSummary
s {$sel:decoderManifestArn:VehicleSummary' :: Text
decoderManifestArn = Text
a} :: VehicleSummary)

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

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

instance Data.FromJSON VehicleSummary where
  parseJSON :: Value -> Parser VehicleSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VehicleSummary"
      ( \Object
x ->
          Text -> Text -> Text -> Text -> POSIX -> POSIX -> VehicleSummary
VehicleSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"vehicleName")
            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
"modelManifestArn")
            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
"decoderManifestArn")
            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 VehicleSummary where
  hashWithSalt :: Int -> VehicleSummary -> Int
hashWithSalt Int
_salt VehicleSummary' {Text
POSIX
lastModificationTime :: POSIX
creationTime :: POSIX
decoderManifestArn :: Text
modelManifestArn :: Text
arn :: Text
vehicleName :: Text
$sel:lastModificationTime:VehicleSummary' :: VehicleSummary -> POSIX
$sel:creationTime:VehicleSummary' :: VehicleSummary -> POSIX
$sel:decoderManifestArn:VehicleSummary' :: VehicleSummary -> Text
$sel:modelManifestArn:VehicleSummary' :: VehicleSummary -> Text
$sel:arn:VehicleSummary' :: VehicleSummary -> Text
$sel:vehicleName:VehicleSummary' :: VehicleSummary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vehicleName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
modelManifestArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
decoderManifestArn
      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 VehicleSummary where
  rnf :: VehicleSummary -> ()
rnf VehicleSummary' {Text
POSIX
lastModificationTime :: POSIX
creationTime :: POSIX
decoderManifestArn :: Text
modelManifestArn :: Text
arn :: Text
vehicleName :: Text
$sel:lastModificationTime:VehicleSummary' :: VehicleSummary -> POSIX
$sel:creationTime:VehicleSummary' :: VehicleSummary -> POSIX
$sel:decoderManifestArn:VehicleSummary' :: VehicleSummary -> Text
$sel:modelManifestArn:VehicleSummary' :: VehicleSummary -> Text
$sel:arn:VehicleSummary' :: VehicleSummary -> Text
$sel:vehicleName:VehicleSummary' :: VehicleSummary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
vehicleName
      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
modelManifestArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
decoderManifestArn
      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