{-# 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.ListMapsResponseEntry
-- 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.Location.Types.ListMapsResponseEntry where

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

-- | Contains details of an existing map resource in your AWS account.
--
-- /See:/ 'newListMapsResponseEntry' smart constructor.
data ListMapsResponseEntry = ListMapsResponseEntry'
  { -- | No longer used. Always returns @RequestBasedUsage@.
    ListMapsResponseEntry -> Maybe PricingPlan
pricingPlan :: Prelude.Maybe PricingPlan,
    -- | The timestamp for when the map resource was created in
    -- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
    -- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
    ListMapsResponseEntry -> ISO8601
createTime :: Data.ISO8601,
    -- | Specifies the data provider for the associated map tiles.
    ListMapsResponseEntry -> Text
dataSource :: Prelude.Text,
    -- | The description for the map resource.
    ListMapsResponseEntry -> Text
description :: Prelude.Text,
    -- | The name of the associated map resource.
    ListMapsResponseEntry -> Text
mapName :: Prelude.Text,
    -- | The timestamp for when the map resource was last updated in
    -- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
    -- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
    ListMapsResponseEntry -> ISO8601
updateTime :: Data.ISO8601
  }
  deriving (ListMapsResponseEntry -> ListMapsResponseEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMapsResponseEntry -> ListMapsResponseEntry -> Bool
$c/= :: ListMapsResponseEntry -> ListMapsResponseEntry -> Bool
== :: ListMapsResponseEntry -> ListMapsResponseEntry -> Bool
$c== :: ListMapsResponseEntry -> ListMapsResponseEntry -> Bool
Prelude.Eq, ReadPrec [ListMapsResponseEntry]
ReadPrec ListMapsResponseEntry
Int -> ReadS ListMapsResponseEntry
ReadS [ListMapsResponseEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMapsResponseEntry]
$creadListPrec :: ReadPrec [ListMapsResponseEntry]
readPrec :: ReadPrec ListMapsResponseEntry
$creadPrec :: ReadPrec ListMapsResponseEntry
readList :: ReadS [ListMapsResponseEntry]
$creadList :: ReadS [ListMapsResponseEntry]
readsPrec :: Int -> ReadS ListMapsResponseEntry
$creadsPrec :: Int -> ReadS ListMapsResponseEntry
Prelude.Read, Int -> ListMapsResponseEntry -> ShowS
[ListMapsResponseEntry] -> ShowS
ListMapsResponseEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMapsResponseEntry] -> ShowS
$cshowList :: [ListMapsResponseEntry] -> ShowS
show :: ListMapsResponseEntry -> String
$cshow :: ListMapsResponseEntry -> String
showsPrec :: Int -> ListMapsResponseEntry -> ShowS
$cshowsPrec :: Int -> ListMapsResponseEntry -> ShowS
Prelude.Show, forall x. Rep ListMapsResponseEntry x -> ListMapsResponseEntry
forall x. ListMapsResponseEntry -> Rep ListMapsResponseEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMapsResponseEntry x -> ListMapsResponseEntry
$cfrom :: forall x. ListMapsResponseEntry -> Rep ListMapsResponseEntry x
Prelude.Generic)

-- |
-- Create a value of 'ListMapsResponseEntry' 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:
--
-- 'pricingPlan', 'listMapsResponseEntry_pricingPlan' - No longer used. Always returns @RequestBasedUsage@.
--
-- 'createTime', 'listMapsResponseEntry_createTime' - The timestamp for when the map resource was created in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
--
-- 'dataSource', 'listMapsResponseEntry_dataSource' - Specifies the data provider for the associated map tiles.
--
-- 'description', 'listMapsResponseEntry_description' - The description for the map resource.
--
-- 'mapName', 'listMapsResponseEntry_mapName' - The name of the associated map resource.
--
-- 'updateTime', 'listMapsResponseEntry_updateTime' - The timestamp for when the map resource was last updated in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
newListMapsResponseEntry ::
  -- | 'createTime'
  Prelude.UTCTime ->
  -- | 'dataSource'
  Prelude.Text ->
  -- | 'description'
  Prelude.Text ->
  -- | 'mapName'
  Prelude.Text ->
  -- | 'updateTime'
  Prelude.UTCTime ->
  ListMapsResponseEntry
newListMapsResponseEntry :: UTCTime -> Text -> Text -> Text -> UTCTime -> ListMapsResponseEntry
newListMapsResponseEntry
  UTCTime
pCreateTime_
  Text
pDataSource_
  Text
pDescription_
  Text
pMapName_
  UTCTime
pUpdateTime_ =
    ListMapsResponseEntry'
      { $sel:pricingPlan:ListMapsResponseEntry' :: Maybe PricingPlan
pricingPlan =
          forall a. Maybe a
Prelude.Nothing,
        $sel:createTime:ListMapsResponseEntry' :: ISO8601
createTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreateTime_,
        $sel:dataSource:ListMapsResponseEntry' :: Text
dataSource = Text
pDataSource_,
        $sel:description:ListMapsResponseEntry' :: Text
description = Text
pDescription_,
        $sel:mapName:ListMapsResponseEntry' :: Text
mapName = Text
pMapName_,
        $sel:updateTime:ListMapsResponseEntry' :: ISO8601
updateTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateTime_
      }

-- | No longer used. Always returns @RequestBasedUsage@.
listMapsResponseEntry_pricingPlan :: Lens.Lens' ListMapsResponseEntry (Prelude.Maybe PricingPlan)
listMapsResponseEntry_pricingPlan :: Lens' ListMapsResponseEntry (Maybe PricingPlan)
listMapsResponseEntry_pricingPlan = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapsResponseEntry' {Maybe PricingPlan
pricingPlan :: Maybe PricingPlan
$sel:pricingPlan:ListMapsResponseEntry' :: ListMapsResponseEntry -> Maybe PricingPlan
pricingPlan} -> Maybe PricingPlan
pricingPlan) (\s :: ListMapsResponseEntry
s@ListMapsResponseEntry' {} Maybe PricingPlan
a -> ListMapsResponseEntry
s {$sel:pricingPlan:ListMapsResponseEntry' :: Maybe PricingPlan
pricingPlan = Maybe PricingPlan
a} :: ListMapsResponseEntry)

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

-- | Specifies the data provider for the associated map tiles.
listMapsResponseEntry_dataSource :: Lens.Lens' ListMapsResponseEntry Prelude.Text
listMapsResponseEntry_dataSource :: Lens' ListMapsResponseEntry Text
listMapsResponseEntry_dataSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapsResponseEntry' {Text
dataSource :: Text
$sel:dataSource:ListMapsResponseEntry' :: ListMapsResponseEntry -> Text
dataSource} -> Text
dataSource) (\s :: ListMapsResponseEntry
s@ListMapsResponseEntry' {} Text
a -> ListMapsResponseEntry
s {$sel:dataSource:ListMapsResponseEntry' :: Text
dataSource = Text
a} :: ListMapsResponseEntry)

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

-- | The name of the associated map resource.
listMapsResponseEntry_mapName :: Lens.Lens' ListMapsResponseEntry Prelude.Text
listMapsResponseEntry_mapName :: Lens' ListMapsResponseEntry Text
listMapsResponseEntry_mapName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapsResponseEntry' {Text
mapName :: Text
$sel:mapName:ListMapsResponseEntry' :: ListMapsResponseEntry -> Text
mapName} -> Text
mapName) (\s :: ListMapsResponseEntry
s@ListMapsResponseEntry' {} Text
a -> ListMapsResponseEntry
s {$sel:mapName:ListMapsResponseEntry' :: Text
mapName = Text
a} :: ListMapsResponseEntry)

-- | The timestamp for when the map resource was last updated in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
listMapsResponseEntry_updateTime :: Lens.Lens' ListMapsResponseEntry Prelude.UTCTime
listMapsResponseEntry_updateTime :: Lens' ListMapsResponseEntry UTCTime
listMapsResponseEntry_updateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMapsResponseEntry' {ISO8601
updateTime :: ISO8601
$sel:updateTime:ListMapsResponseEntry' :: ListMapsResponseEntry -> ISO8601
updateTime} -> ISO8601
updateTime) (\s :: ListMapsResponseEntry
s@ListMapsResponseEntry' {} ISO8601
a -> ListMapsResponseEntry
s {$sel:updateTime:ListMapsResponseEntry' :: ISO8601
updateTime = ISO8601
a} :: ListMapsResponseEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON ListMapsResponseEntry where
  parseJSON :: Value -> Parser ListMapsResponseEntry
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ListMapsResponseEntry"
      ( \Object
x ->
          Maybe PricingPlan
-> ISO8601
-> Text
-> Text
-> Text
-> ISO8601
-> ListMapsResponseEntry
ListMapsResponseEntry'
            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
"PricingPlan")
            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
"CreateTime")
            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
"DataSource")
            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
"Description")
            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
"MapName")
            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
"UpdateTime")
      )

instance Prelude.Hashable ListMapsResponseEntry where
  hashWithSalt :: Int -> ListMapsResponseEntry -> Int
hashWithSalt Int
_salt ListMapsResponseEntry' {Maybe PricingPlan
Text
ISO8601
updateTime :: ISO8601
mapName :: Text
description :: Text
dataSource :: Text
createTime :: ISO8601
pricingPlan :: Maybe PricingPlan
$sel:updateTime:ListMapsResponseEntry' :: ListMapsResponseEntry -> ISO8601
$sel:mapName:ListMapsResponseEntry' :: ListMapsResponseEntry -> Text
$sel:description:ListMapsResponseEntry' :: ListMapsResponseEntry -> Text
$sel:dataSource:ListMapsResponseEntry' :: ListMapsResponseEntry -> Text
$sel:createTime:ListMapsResponseEntry' :: ListMapsResponseEntry -> ISO8601
$sel:pricingPlan:ListMapsResponseEntry' :: ListMapsResponseEntry -> Maybe PricingPlan
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PricingPlan
pricingPlan
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
createTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dataSource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
mapName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
updateTime

instance Prelude.NFData ListMapsResponseEntry where
  rnf :: ListMapsResponseEntry -> ()
rnf ListMapsResponseEntry' {Maybe PricingPlan
Text
ISO8601
updateTime :: ISO8601
mapName :: Text
description :: Text
dataSource :: Text
createTime :: ISO8601
pricingPlan :: Maybe PricingPlan
$sel:updateTime:ListMapsResponseEntry' :: ListMapsResponseEntry -> ISO8601
$sel:mapName:ListMapsResponseEntry' :: ListMapsResponseEntry -> Text
$sel:description:ListMapsResponseEntry' :: ListMapsResponseEntry -> Text
$sel:dataSource:ListMapsResponseEntry' :: ListMapsResponseEntry -> Text
$sel:createTime:ListMapsResponseEntry' :: ListMapsResponseEntry -> ISO8601
$sel:pricingPlan:ListMapsResponseEntry' :: ListMapsResponseEntry -> Maybe PricingPlan
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe PricingPlan
pricingPlan
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
createTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dataSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
mapName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
updateTime