{-# 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.Location.Types.ListTrackersResponseEntry
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Location.Types.ListTrackersResponseEntry where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types.PricingPlan
import qualified Amazonka.Prelude as Prelude

-- | Contains the tracker resource details.
--
-- /See:/ 'newListTrackersResponseEntry' smart constructor.
data ListTrackersResponseEntry = ListTrackersResponseEntry'
  { -- | The specified data provider for the tracker resource.
    ListTrackersResponseEntry -> Maybe Text
pricingPlanDataSource :: Prelude.Maybe Prelude.Text,
    -- | The timestamp for when the tracker resource was created in
    -- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
    -- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
    ListTrackersResponseEntry -> POSIX
createTime :: Core.POSIX,
    -- | The description for the tracker resource.
    ListTrackersResponseEntry -> Text
description :: Prelude.Text,
    -- | The pricing plan for the specified tracker resource.
    --
    -- For additional details and restrictions on each pricing plan option, see
    -- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing>.
    ListTrackersResponseEntry -> PricingPlan
pricingPlan :: PricingPlan,
    -- | The name of the tracker resource.
    ListTrackersResponseEntry -> Text
trackerName :: Prelude.Text,
    -- | The timestamp at which the device\'s position was determined. Uses
    -- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
    -- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
    ListTrackersResponseEntry -> POSIX
updateTime :: Core.POSIX
  }
  deriving (ListTrackersResponseEntry -> ListTrackersResponseEntry -> Bool
(ListTrackersResponseEntry -> ListTrackersResponseEntry -> Bool)
-> (ListTrackersResponseEntry -> ListTrackersResponseEntry -> Bool)
-> Eq ListTrackersResponseEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTrackersResponseEntry -> ListTrackersResponseEntry -> Bool
$c/= :: ListTrackersResponseEntry -> ListTrackersResponseEntry -> Bool
== :: ListTrackersResponseEntry -> ListTrackersResponseEntry -> Bool
$c== :: ListTrackersResponseEntry -> ListTrackersResponseEntry -> Bool
Prelude.Eq, ReadPrec [ListTrackersResponseEntry]
ReadPrec ListTrackersResponseEntry
Int -> ReadS ListTrackersResponseEntry
ReadS [ListTrackersResponseEntry]
(Int -> ReadS ListTrackersResponseEntry)
-> ReadS [ListTrackersResponseEntry]
-> ReadPrec ListTrackersResponseEntry
-> ReadPrec [ListTrackersResponseEntry]
-> Read ListTrackersResponseEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTrackersResponseEntry]
$creadListPrec :: ReadPrec [ListTrackersResponseEntry]
readPrec :: ReadPrec ListTrackersResponseEntry
$creadPrec :: ReadPrec ListTrackersResponseEntry
readList :: ReadS [ListTrackersResponseEntry]
$creadList :: ReadS [ListTrackersResponseEntry]
readsPrec :: Int -> ReadS ListTrackersResponseEntry
$creadsPrec :: Int -> ReadS ListTrackersResponseEntry
Prelude.Read, Int -> ListTrackersResponseEntry -> ShowS
[ListTrackersResponseEntry] -> ShowS
ListTrackersResponseEntry -> String
(Int -> ListTrackersResponseEntry -> ShowS)
-> (ListTrackersResponseEntry -> String)
-> ([ListTrackersResponseEntry] -> ShowS)
-> Show ListTrackersResponseEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTrackersResponseEntry] -> ShowS
$cshowList :: [ListTrackersResponseEntry] -> ShowS
show :: ListTrackersResponseEntry -> String
$cshow :: ListTrackersResponseEntry -> String
showsPrec :: Int -> ListTrackersResponseEntry -> ShowS
$cshowsPrec :: Int -> ListTrackersResponseEntry -> ShowS
Prelude.Show, (forall x.
 ListTrackersResponseEntry -> Rep ListTrackersResponseEntry x)
-> (forall x.
    Rep ListTrackersResponseEntry x -> ListTrackersResponseEntry)
-> Generic ListTrackersResponseEntry
forall x.
Rep ListTrackersResponseEntry x -> ListTrackersResponseEntry
forall x.
ListTrackersResponseEntry -> Rep ListTrackersResponseEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTrackersResponseEntry x -> ListTrackersResponseEntry
$cfrom :: forall x.
ListTrackersResponseEntry -> Rep ListTrackersResponseEntry x
Prelude.Generic)

-- |
-- Create a value of 'ListTrackersResponseEntry' 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:
--
-- 'pricingPlanDataSource', 'listTrackersResponseEntry_pricingPlanDataSource' - The specified data provider for the tracker resource.
--
-- 'createTime', 'listTrackersResponseEntry_createTime' - The timestamp for when the tracker resource was created in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
--
-- 'description', 'listTrackersResponseEntry_description' - The description for the tracker resource.
--
-- 'pricingPlan', 'listTrackersResponseEntry_pricingPlan' - The pricing plan for the specified tracker resource.
--
-- For additional details and restrictions on each pricing plan option, see
-- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing>.
--
-- 'trackerName', 'listTrackersResponseEntry_trackerName' - The name of the tracker resource.
--
-- 'updateTime', 'listTrackersResponseEntry_updateTime' - The timestamp at which the device\'s position was determined. Uses
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
newListTrackersResponseEntry ::
  -- | 'createTime'
  Prelude.UTCTime ->
  -- | 'description'
  Prelude.Text ->
  -- | 'pricingPlan'
  PricingPlan ->
  -- | 'trackerName'
  Prelude.Text ->
  -- | 'updateTime'
  Prelude.UTCTime ->
  ListTrackersResponseEntry
newListTrackersResponseEntry :: UTCTime
-> Text
-> PricingPlan
-> Text
-> UTCTime
-> ListTrackersResponseEntry
newListTrackersResponseEntry
  UTCTime
pCreateTime_
  Text
pDescription_
  PricingPlan
pPricingPlan_
  Text
pTrackerName_
  UTCTime
pUpdateTime_ =
    ListTrackersResponseEntry' :: Maybe Text
-> POSIX
-> Text
-> PricingPlan
-> Text
-> POSIX
-> ListTrackersResponseEntry
ListTrackersResponseEntry'
      { $sel:pricingPlanDataSource:ListTrackersResponseEntry' :: Maybe Text
pricingPlanDataSource =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:createTime:ListTrackersResponseEntry' :: POSIX
createTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreateTime_,
        $sel:description:ListTrackersResponseEntry' :: Text
description = Text
pDescription_,
        $sel:pricingPlan:ListTrackersResponseEntry' :: PricingPlan
pricingPlan = PricingPlan
pPricingPlan_,
        $sel:trackerName:ListTrackersResponseEntry' :: Text
trackerName = Text
pTrackerName_,
        $sel:updateTime:ListTrackersResponseEntry' :: POSIX
updateTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateTime_
      }

-- | The specified data provider for the tracker resource.
listTrackersResponseEntry_pricingPlanDataSource :: Lens.Lens' ListTrackersResponseEntry (Prelude.Maybe Prelude.Text)
listTrackersResponseEntry_pricingPlanDataSource :: (Maybe Text -> f (Maybe Text))
-> ListTrackersResponseEntry -> f ListTrackersResponseEntry
listTrackersResponseEntry_pricingPlanDataSource = (ListTrackersResponseEntry -> Maybe Text)
-> (ListTrackersResponseEntry
    -> Maybe Text -> ListTrackersResponseEntry)
-> Lens
     ListTrackersResponseEntry
     ListTrackersResponseEntry
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackersResponseEntry' {Maybe Text
pricingPlanDataSource :: Maybe Text
$sel:pricingPlanDataSource:ListTrackersResponseEntry' :: ListTrackersResponseEntry -> Maybe Text
pricingPlanDataSource} -> Maybe Text
pricingPlanDataSource) (\s :: ListTrackersResponseEntry
s@ListTrackersResponseEntry' {} Maybe Text
a -> ListTrackersResponseEntry
s {$sel:pricingPlanDataSource:ListTrackersResponseEntry' :: Maybe Text
pricingPlanDataSource = Maybe Text
a} :: ListTrackersResponseEntry)

-- | The timestamp for when the tracker resource was created in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
listTrackersResponseEntry_createTime :: Lens.Lens' ListTrackersResponseEntry Prelude.UTCTime
listTrackersResponseEntry_createTime :: (UTCTime -> f UTCTime)
-> ListTrackersResponseEntry -> f ListTrackersResponseEntry
listTrackersResponseEntry_createTime = (ListTrackersResponseEntry -> POSIX)
-> (ListTrackersResponseEntry
    -> POSIX -> ListTrackersResponseEntry)
-> Lens
     ListTrackersResponseEntry ListTrackersResponseEntry POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackersResponseEntry' {POSIX
createTime :: POSIX
$sel:createTime:ListTrackersResponseEntry' :: ListTrackersResponseEntry -> POSIX
createTime} -> POSIX
createTime) (\s :: ListTrackersResponseEntry
s@ListTrackersResponseEntry' {} POSIX
a -> ListTrackersResponseEntry
s {$sel:createTime:ListTrackersResponseEntry' :: POSIX
createTime = POSIX
a} :: ListTrackersResponseEntry) ((POSIX -> f POSIX)
 -> ListTrackersResponseEntry -> f ListTrackersResponseEntry)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListTrackersResponseEntry
-> f ListTrackersResponseEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The description for the tracker resource.
listTrackersResponseEntry_description :: Lens.Lens' ListTrackersResponseEntry Prelude.Text
listTrackersResponseEntry_description :: (Text -> f Text)
-> ListTrackersResponseEntry -> f ListTrackersResponseEntry
listTrackersResponseEntry_description = (ListTrackersResponseEntry -> Text)
-> (ListTrackersResponseEntry -> Text -> ListTrackersResponseEntry)
-> Lens
     ListTrackersResponseEntry ListTrackersResponseEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackersResponseEntry' {Text
description :: Text
$sel:description:ListTrackersResponseEntry' :: ListTrackersResponseEntry -> Text
description} -> Text
description) (\s :: ListTrackersResponseEntry
s@ListTrackersResponseEntry' {} Text
a -> ListTrackersResponseEntry
s {$sel:description:ListTrackersResponseEntry' :: Text
description = Text
a} :: ListTrackersResponseEntry)

-- | The pricing plan for the specified tracker resource.
--
-- For additional details and restrictions on each pricing plan option, see
-- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing>.
listTrackersResponseEntry_pricingPlan :: Lens.Lens' ListTrackersResponseEntry PricingPlan
listTrackersResponseEntry_pricingPlan :: (PricingPlan -> f PricingPlan)
-> ListTrackersResponseEntry -> f ListTrackersResponseEntry
listTrackersResponseEntry_pricingPlan = (ListTrackersResponseEntry -> PricingPlan)
-> (ListTrackersResponseEntry
    -> PricingPlan -> ListTrackersResponseEntry)
-> Lens
     ListTrackersResponseEntry
     ListTrackersResponseEntry
     PricingPlan
     PricingPlan
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackersResponseEntry' {PricingPlan
pricingPlan :: PricingPlan
$sel:pricingPlan:ListTrackersResponseEntry' :: ListTrackersResponseEntry -> PricingPlan
pricingPlan} -> PricingPlan
pricingPlan) (\s :: ListTrackersResponseEntry
s@ListTrackersResponseEntry' {} PricingPlan
a -> ListTrackersResponseEntry
s {$sel:pricingPlan:ListTrackersResponseEntry' :: PricingPlan
pricingPlan = PricingPlan
a} :: ListTrackersResponseEntry)

-- | The name of the tracker resource.
listTrackersResponseEntry_trackerName :: Lens.Lens' ListTrackersResponseEntry Prelude.Text
listTrackersResponseEntry_trackerName :: (Text -> f Text)
-> ListTrackersResponseEntry -> f ListTrackersResponseEntry
listTrackersResponseEntry_trackerName = (ListTrackersResponseEntry -> Text)
-> (ListTrackersResponseEntry -> Text -> ListTrackersResponseEntry)
-> Lens
     ListTrackersResponseEntry ListTrackersResponseEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackersResponseEntry' {Text
trackerName :: Text
$sel:trackerName:ListTrackersResponseEntry' :: ListTrackersResponseEntry -> Text
trackerName} -> Text
trackerName) (\s :: ListTrackersResponseEntry
s@ListTrackersResponseEntry' {} Text
a -> ListTrackersResponseEntry
s {$sel:trackerName:ListTrackersResponseEntry' :: Text
trackerName = Text
a} :: ListTrackersResponseEntry)

-- | The timestamp at which the device\'s position was determined. Uses
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
listTrackersResponseEntry_updateTime :: Lens.Lens' ListTrackersResponseEntry Prelude.UTCTime
listTrackersResponseEntry_updateTime :: (UTCTime -> f UTCTime)
-> ListTrackersResponseEntry -> f ListTrackersResponseEntry
listTrackersResponseEntry_updateTime = (ListTrackersResponseEntry -> POSIX)
-> (ListTrackersResponseEntry
    -> POSIX -> ListTrackersResponseEntry)
-> Lens
     ListTrackersResponseEntry ListTrackersResponseEntry POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackersResponseEntry' {POSIX
updateTime :: POSIX
$sel:updateTime:ListTrackersResponseEntry' :: ListTrackersResponseEntry -> POSIX
updateTime} -> POSIX
updateTime) (\s :: ListTrackersResponseEntry
s@ListTrackersResponseEntry' {} POSIX
a -> ListTrackersResponseEntry
s {$sel:updateTime:ListTrackersResponseEntry' :: POSIX
updateTime = POSIX
a} :: ListTrackersResponseEntry) ((POSIX -> f POSIX)
 -> ListTrackersResponseEntry -> f ListTrackersResponseEntry)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListTrackersResponseEntry
-> f ListTrackersResponseEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromJSON ListTrackersResponseEntry where
  parseJSON :: Value -> Parser ListTrackersResponseEntry
parseJSON =
    String
-> (Object -> Parser ListTrackersResponseEntry)
-> Value
-> Parser ListTrackersResponseEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListTrackersResponseEntry"
      ( \Object
x ->
          Maybe Text
-> POSIX
-> Text
-> PricingPlan
-> Text
-> POSIX
-> ListTrackersResponseEntry
ListTrackersResponseEntry'
            (Maybe Text
 -> POSIX
 -> Text
 -> PricingPlan
 -> Text
 -> POSIX
 -> ListTrackersResponseEntry)
-> Parser (Maybe Text)
-> Parser
     (POSIX
      -> Text
      -> PricingPlan
      -> Text
      -> POSIX
      -> ListTrackersResponseEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PricingPlanDataSource")
            Parser
  (POSIX
   -> Text
   -> PricingPlan
   -> Text
   -> POSIX
   -> ListTrackersResponseEntry)
-> Parser POSIX
-> Parser
     (Text -> PricingPlan -> Text -> POSIX -> ListTrackersResponseEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreateTime")
            Parser
  (Text -> PricingPlan -> Text -> POSIX -> ListTrackersResponseEntry)
-> Parser Text
-> Parser
     (PricingPlan -> Text -> POSIX -> ListTrackersResponseEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Description")
            Parser (PricingPlan -> Text -> POSIX -> ListTrackersResponseEntry)
-> Parser PricingPlan
-> Parser (Text -> POSIX -> ListTrackersResponseEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser PricingPlan
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"PricingPlan")
            Parser (Text -> POSIX -> ListTrackersResponseEntry)
-> Parser Text -> Parser (POSIX -> ListTrackersResponseEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TrackerName")
            Parser (POSIX -> ListTrackersResponseEntry)
-> Parser POSIX -> Parser ListTrackersResponseEntry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UpdateTime")
      )

instance Prelude.Hashable ListTrackersResponseEntry

instance Prelude.NFData ListTrackersResponseEntry