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

-- | 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 -> ISO8601
createTime :: Data.ISO8601,
    -- | 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 -> ISO8601
updateTime :: Data.ISO8601
  }
  deriving (BatchPutGeofenceSuccess -> BatchPutGeofenceSuccess -> Bool
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]
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
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. 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'
      { $sel:createTime:BatchPutGeofenceSuccess' :: ISO8601
createTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreateTime_,
        $sel:geofenceId:BatchPutGeofenceSuccess' :: Text
geofenceId = Text
pGeofenceId_,
        $sel:updateTime:BatchPutGeofenceSuccess' :: ISO8601
updateTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' BatchPutGeofenceSuccess UTCTime
batchPutGeofenceSuccess_createTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceSuccess' {ISO8601
createTime :: ISO8601
$sel:createTime:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> ISO8601
createTime} -> ISO8601
createTime) (\s :: BatchPutGeofenceSuccess
s@BatchPutGeofenceSuccess' {} ISO8601
a -> BatchPutGeofenceSuccess
s {$sel:createTime:BatchPutGeofenceSuccess' :: ISO8601
createTime = ISO8601
a} :: BatchPutGeofenceSuccess) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The geofence successfully stored in a geofence collection.
batchPutGeofenceSuccess_geofenceId :: Lens.Lens' BatchPutGeofenceSuccess Prelude.Text
batchPutGeofenceSuccess_geofenceId :: Lens' BatchPutGeofenceSuccess Text
batchPutGeofenceSuccess_geofenceId = 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 :: Lens' BatchPutGeofenceSuccess UTCTime
batchPutGeofenceSuccess_updateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceSuccess' {ISO8601
updateTime :: ISO8601
$sel:updateTime:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> ISO8601
updateTime} -> ISO8601
updateTime) (\s :: BatchPutGeofenceSuccess
s@BatchPutGeofenceSuccess' {} ISO8601
a -> BatchPutGeofenceSuccess
s {$sel:updateTime:BatchPutGeofenceSuccess' :: ISO8601
updateTime = ISO8601
a} :: BatchPutGeofenceSuccess) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON BatchPutGeofenceSuccess where
  parseJSON :: Value -> Parser BatchPutGeofenceSuccess
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchPutGeofenceSuccess"
      ( \Object
x ->
          ISO8601 -> Text -> ISO8601 -> BatchPutGeofenceSuccess
BatchPutGeofenceSuccess'
            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
"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
"GeofenceId")
            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 BatchPutGeofenceSuccess where
  hashWithSalt :: Int -> BatchPutGeofenceSuccess -> Int
hashWithSalt Int
_salt BatchPutGeofenceSuccess' {Text
ISO8601
updateTime :: ISO8601
geofenceId :: Text
createTime :: ISO8601
$sel:updateTime:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> ISO8601
$sel:geofenceId:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> Text
$sel:createTime:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
createTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
geofenceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
updateTime

instance Prelude.NFData BatchPutGeofenceSuccess where
  rnf :: BatchPutGeofenceSuccess -> ()
rnf BatchPutGeofenceSuccess' {Text
ISO8601
updateTime :: ISO8601
geofenceId :: Text
createTime :: ISO8601
$sel:updateTime:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> ISO8601
$sel:geofenceId:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> Text
$sel:createTime:BatchPutGeofenceSuccess' :: BatchPutGeofenceSuccess -> ISO8601
..} =
    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
geofenceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
updateTime