{-# 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.BatchPutGeofenceSuccess
-- 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.BatchPutGeofenceSuccess where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains a summary of each geofence that was successfully stored in a
-- given geofence collection.
--
-- /See:/ 'newBatchPutGeofenceSuccess' smart constructor.
data BatchPutGeofenceSuccess = BatchPutGeofenceSuccess'
  { -- | The timestamp for when the geofence was stored in a geofence collection
    -- in <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
    -- format: @YYYY-MM-DDThh:mm:ss.sssZ@
    BatchPutGeofenceSuccess -> POSIX
createTime :: Core.POSIX,
    -- | The geofence successfully stored in a geofence collection.
    BatchPutGeofenceSuccess -> Text
geofenceId :: Prelude.Text,
    -- | The timestamp for when the geofence was last updated in
    -- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
    -- format: @YYYY-MM-DDThh:mm:ss.sssZ@
    BatchPutGeofenceSuccess -> POSIX
updateTime :: Core.POSIX
  }
  deriving (BatchPutGeofenceSuccess -> BatchPutGeofenceSuccess -> Bool
(BatchPutGeofenceSuccess -> BatchPutGeofenceSuccess -> Bool)
-> (BatchPutGeofenceSuccess -> BatchPutGeofenceSuccess -> Bool)
-> Eq BatchPutGeofenceSuccess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchPutGeofenceSuccess -> BatchPutGeofenceSuccess -> Bool
$c/= :: BatchPutGeofenceSuccess -> BatchPutGeofenceSuccess -> Bool
== :: BatchPutGeofenceSuccess -> BatchPutGeofenceSuccess -> Bool
$c== :: BatchPutGeofenceSuccess -> BatchPutGeofenceSuccess -> Bool
Prelude.Eq, ReadPrec [BatchPutGeofenceSuccess]
ReadPrec BatchPutGeofenceSuccess
Int -> ReadS BatchPutGeofenceSuccess
ReadS [BatchPutGeofenceSuccess]
(Int -> ReadS BatchPutGeofenceSuccess)
-> ReadS [BatchPutGeofenceSuccess]
-> ReadPrec BatchPutGeofenceSuccess
-> ReadPrec [BatchPutGeofenceSuccess]
-> Read BatchPutGeofenceSuccess
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchPutGeofenceSuccess]
$creadListPrec :: ReadPrec [BatchPutGeofenceSuccess]
readPrec :: ReadPrec BatchPutGeofenceSuccess
$creadPrec :: ReadPrec BatchPutGeofenceSuccess
readList :: ReadS [BatchPutGeofenceSuccess]
$creadList :: ReadS [BatchPutGeofenceSuccess]
readsPrec :: Int -> ReadS BatchPutGeofenceSuccess
$creadsPrec :: Int -> ReadS BatchPutGeofenceSuccess
Prelude.Read, Int -> BatchPutGeofenceSuccess -> ShowS
[BatchPutGeofenceSuccess] -> ShowS
BatchPutGeofenceSuccess -> String
(Int -> BatchPutGeofenceSuccess -> ShowS)
-> (BatchPutGeofenceSuccess -> String)
-> ([BatchPutGeofenceSuccess] -> ShowS)
-> Show BatchPutGeofenceSuccess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchPutGeofenceSuccess] -> ShowS
$cshowList :: [BatchPutGeofenceSuccess] -> ShowS
show :: BatchPutGeofenceSuccess -> String
$cshow :: BatchPutGeofenceSuccess -> String
showsPrec :: Int -> BatchPutGeofenceSuccess -> ShowS
$cshowsPrec :: Int -> BatchPutGeofenceSuccess -> ShowS
Prelude.Show, (forall x.
 BatchPutGeofenceSuccess -> Rep BatchPutGeofenceSuccess x)
-> (forall x.
    Rep BatchPutGeofenceSuccess x -> BatchPutGeofenceSuccess)
-> Generic BatchPutGeofenceSuccess
forall x. Rep BatchPutGeofenceSuccess x -> BatchPutGeofenceSuccess
forall x. BatchPutGeofenceSuccess -> Rep BatchPutGeofenceSuccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchPutGeofenceSuccess x -> BatchPutGeofenceSuccess
$cfrom :: forall x. BatchPutGeofenceSuccess -> Rep BatchPutGeofenceSuccess x
Prelude.Generic)

-- |
-- Create a value of 'BatchPutGeofenceSuccess' 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:
--
-- 'createTime', 'batchPutGeofenceSuccess_createTime' - The timestamp for when the geofence was stored in a geofence collection
-- in <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@
--
-- 'geofenceId', 'batchPutGeofenceSuccess_geofenceId' - The geofence successfully stored in a geofence collection.
--
-- 'updateTime', 'batchPutGeofenceSuccess_updateTime' - The timestamp for when the geofence was last updated in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@
newBatchPutGeofenceSuccess ::
  -- | 'createTime'
  Prelude.UTCTime ->
  -- | 'geofenceId'
  Prelude.Text ->
  -- | 'updateTime'
  Prelude.UTCTime ->
  BatchPutGeofenceSuccess
newBatchPutGeofenceSuccess :: UTCTime -> Text -> UTCTime -> BatchPutGeofenceSuccess
newBatchPutGeofenceSuccess
  UTCTime
pCreateTime_
  Text
pGeofenceId_
  UTCTime
pUpdateTime_ =
    BatchPutGeofenceSuccess' :: POSIX -> Text -> POSIX -> BatchPutGeofenceSuccess
BatchPutGeofenceSuccess'
      { $sel:createTime:BatchPutGeofenceSuccess' :: 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:geofenceId:BatchPutGeofenceSuccess' :: Text
geofenceId = Text
pGeofenceId_,
        $sel:updateTime:BatchPutGeofenceSuccess' :: 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 timestamp for when the geofence was stored in a geofence collection
-- in <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@
batchPutGeofenceSuccess_createTime :: Lens.Lens' BatchPutGeofenceSuccess Prelude.UTCTime
batchPutGeofenceSuccess_createTime :: (UTCTime -> f UTCTime)
-> BatchPutGeofenceSuccess -> f BatchPutGeofenceSuccess
batchPutGeofenceSuccess_createTime = (BatchPutGeofenceSuccess -> POSIX)
-> (BatchPutGeofenceSuccess -> POSIX -> BatchPutGeofenceSuccess)
-> Lens BatchPutGeofenceSuccess BatchPutGeofenceSuccess POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceSuccess' {POSIX
createTime :: POSIX
$sel:createTime:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> POSIX
createTime} -> POSIX
createTime) (\s :: BatchPutGeofenceSuccess
s@BatchPutGeofenceSuccess' {} POSIX
a -> BatchPutGeofenceSuccess
s {$sel:createTime:BatchPutGeofenceSuccess' :: POSIX
createTime = POSIX
a} :: BatchPutGeofenceSuccess) ((POSIX -> f POSIX)
 -> BatchPutGeofenceSuccess -> f BatchPutGeofenceSuccess)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> BatchPutGeofenceSuccess
-> f BatchPutGeofenceSuccess
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 geofence successfully stored in a geofence collection.
batchPutGeofenceSuccess_geofenceId :: Lens.Lens' BatchPutGeofenceSuccess Prelude.Text
batchPutGeofenceSuccess_geofenceId :: (Text -> f Text)
-> BatchPutGeofenceSuccess -> f BatchPutGeofenceSuccess
batchPutGeofenceSuccess_geofenceId = (BatchPutGeofenceSuccess -> Text)
-> (BatchPutGeofenceSuccess -> Text -> BatchPutGeofenceSuccess)
-> Lens BatchPutGeofenceSuccess BatchPutGeofenceSuccess Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceSuccess' {Text
geofenceId :: Text
$sel:geofenceId:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> Text
geofenceId} -> Text
geofenceId) (\s :: BatchPutGeofenceSuccess
s@BatchPutGeofenceSuccess' {} Text
a -> BatchPutGeofenceSuccess
s {$sel:geofenceId:BatchPutGeofenceSuccess' :: Text
geofenceId = Text
a} :: BatchPutGeofenceSuccess)

-- | The timestamp for when the geofence was last updated in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@
batchPutGeofenceSuccess_updateTime :: Lens.Lens' BatchPutGeofenceSuccess Prelude.UTCTime
batchPutGeofenceSuccess_updateTime :: (UTCTime -> f UTCTime)
-> BatchPutGeofenceSuccess -> f BatchPutGeofenceSuccess
batchPutGeofenceSuccess_updateTime = (BatchPutGeofenceSuccess -> POSIX)
-> (BatchPutGeofenceSuccess -> POSIX -> BatchPutGeofenceSuccess)
-> Lens BatchPutGeofenceSuccess BatchPutGeofenceSuccess POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceSuccess' {POSIX
updateTime :: POSIX
$sel:updateTime:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> POSIX
updateTime} -> POSIX
updateTime) (\s :: BatchPutGeofenceSuccess
s@BatchPutGeofenceSuccess' {} POSIX
a -> BatchPutGeofenceSuccess
s {$sel:updateTime:BatchPutGeofenceSuccess' :: POSIX
updateTime = POSIX
a} :: BatchPutGeofenceSuccess) ((POSIX -> f POSIX)
 -> BatchPutGeofenceSuccess -> f BatchPutGeofenceSuccess)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> BatchPutGeofenceSuccess
-> f BatchPutGeofenceSuccess
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 BatchPutGeofenceSuccess where
  parseJSON :: Value -> Parser BatchPutGeofenceSuccess
parseJSON =
    String
-> (Object -> Parser BatchPutGeofenceSuccess)
-> Value
-> Parser BatchPutGeofenceSuccess
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchPutGeofenceSuccess"
      ( \Object
x ->
          POSIX -> Text -> POSIX -> BatchPutGeofenceSuccess
BatchPutGeofenceSuccess'
            (POSIX -> Text -> POSIX -> BatchPutGeofenceSuccess)
-> Parser POSIX
-> Parser (Text -> POSIX -> BatchPutGeofenceSuccess)
forall (f :: * -> *) a b. Functor 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 -> POSIX -> BatchPutGeofenceSuccess)
-> Parser Text -> Parser (POSIX -> BatchPutGeofenceSuccess)
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
"GeofenceId")
            Parser (POSIX -> BatchPutGeofenceSuccess)
-> Parser POSIX -> Parser BatchPutGeofenceSuccess
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 BatchPutGeofenceSuccess

instance Prelude.NFData BatchPutGeofenceSuccess