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

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

-- | Contains a list of geofences stored in a given geofence collection.
--
-- /See:/ 'newListGeofenceResponseEntry' smart constructor.
data ListGeofenceResponseEntry = ListGeofenceResponseEntry'
  { -- | 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@
    ListGeofenceResponseEntry -> POSIX
createTime :: Core.POSIX,
    -- | The geofence identifier.
    ListGeofenceResponseEntry -> Text
geofenceId :: Prelude.Text,
    -- | Contains the geofence geometry details describing a polygon.
    ListGeofenceResponseEntry -> GeofenceGeometry
geometry :: GeofenceGeometry,
    -- | Identifies the state of the geofence. A geofence will hold one of the
    -- following states:
    --
    -- -   @ACTIVE@ — The geofence has been indexed by the system.
    --
    -- -   @PENDING@ — The geofence is being processed by the system.
    --
    -- -   @FAILED@ — The geofence failed to be indexed by the system.
    --
    -- -   @DELETED@ — The geofence has been deleted from the system index.
    --
    -- -   @DELETING@ — The geofence is being deleted from the system index.
    ListGeofenceResponseEntry -> Text
status :: 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@
    ListGeofenceResponseEntry -> POSIX
updateTime :: Core.POSIX
  }
  deriving (ListGeofenceResponseEntry -> ListGeofenceResponseEntry -> Bool
(ListGeofenceResponseEntry -> ListGeofenceResponseEntry -> Bool)
-> (ListGeofenceResponseEntry -> ListGeofenceResponseEntry -> Bool)
-> Eq ListGeofenceResponseEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGeofenceResponseEntry -> ListGeofenceResponseEntry -> Bool
$c/= :: ListGeofenceResponseEntry -> ListGeofenceResponseEntry -> Bool
== :: ListGeofenceResponseEntry -> ListGeofenceResponseEntry -> Bool
$c== :: ListGeofenceResponseEntry -> ListGeofenceResponseEntry -> Bool
Prelude.Eq, Int -> ListGeofenceResponseEntry -> ShowS
[ListGeofenceResponseEntry] -> ShowS
ListGeofenceResponseEntry -> String
(Int -> ListGeofenceResponseEntry -> ShowS)
-> (ListGeofenceResponseEntry -> String)
-> ([ListGeofenceResponseEntry] -> ShowS)
-> Show ListGeofenceResponseEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGeofenceResponseEntry] -> ShowS
$cshowList :: [ListGeofenceResponseEntry] -> ShowS
show :: ListGeofenceResponseEntry -> String
$cshow :: ListGeofenceResponseEntry -> String
showsPrec :: Int -> ListGeofenceResponseEntry -> ShowS
$cshowsPrec :: Int -> ListGeofenceResponseEntry -> ShowS
Prelude.Show, (forall x.
 ListGeofenceResponseEntry -> Rep ListGeofenceResponseEntry x)
-> (forall x.
    Rep ListGeofenceResponseEntry x -> ListGeofenceResponseEntry)
-> Generic ListGeofenceResponseEntry
forall x.
Rep ListGeofenceResponseEntry x -> ListGeofenceResponseEntry
forall x.
ListGeofenceResponseEntry -> Rep ListGeofenceResponseEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGeofenceResponseEntry x -> ListGeofenceResponseEntry
$cfrom :: forall x.
ListGeofenceResponseEntry -> Rep ListGeofenceResponseEntry x
Prelude.Generic)

-- |
-- Create a value of 'ListGeofenceResponseEntry' 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', 'listGeofenceResponseEntry_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', 'listGeofenceResponseEntry_geofenceId' - The geofence identifier.
--
-- 'geometry', 'listGeofenceResponseEntry_geometry' - Contains the geofence geometry details describing a polygon.
--
-- 'status', 'listGeofenceResponseEntry_status' - Identifies the state of the geofence. A geofence will hold one of the
-- following states:
--
-- -   @ACTIVE@ — The geofence has been indexed by the system.
--
-- -   @PENDING@ — The geofence is being processed by the system.
--
-- -   @FAILED@ — The geofence failed to be indexed by the system.
--
-- -   @DELETED@ — The geofence has been deleted from the system index.
--
-- -   @DELETING@ — The geofence is being deleted from the system index.
--
-- 'updateTime', 'listGeofenceResponseEntry_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@
newListGeofenceResponseEntry ::
  -- | 'createTime'
  Prelude.UTCTime ->
  -- | 'geofenceId'
  Prelude.Text ->
  -- | 'geometry'
  GeofenceGeometry ->
  -- | 'status'
  Prelude.Text ->
  -- | 'updateTime'
  Prelude.UTCTime ->
  ListGeofenceResponseEntry
newListGeofenceResponseEntry :: UTCTime
-> Text
-> GeofenceGeometry
-> Text
-> UTCTime
-> ListGeofenceResponseEntry
newListGeofenceResponseEntry
  UTCTime
pCreateTime_
  Text
pGeofenceId_
  GeofenceGeometry
pGeometry_
  Text
pStatus_
  UTCTime
pUpdateTime_ =
    ListGeofenceResponseEntry' :: POSIX
-> Text
-> GeofenceGeometry
-> Text
-> POSIX
-> ListGeofenceResponseEntry
ListGeofenceResponseEntry'
      { $sel:createTime:ListGeofenceResponseEntry' :: 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:ListGeofenceResponseEntry' :: Text
geofenceId = Text
pGeofenceId_,
        $sel:geometry:ListGeofenceResponseEntry' :: GeofenceGeometry
geometry = GeofenceGeometry
pGeometry_,
        $sel:status:ListGeofenceResponseEntry' :: Text
status = Text
pStatus_,
        $sel:updateTime:ListGeofenceResponseEntry' :: 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@
listGeofenceResponseEntry_createTime :: Lens.Lens' ListGeofenceResponseEntry Prelude.UTCTime
listGeofenceResponseEntry_createTime :: (UTCTime -> f UTCTime)
-> ListGeofenceResponseEntry -> f ListGeofenceResponseEntry
listGeofenceResponseEntry_createTime = (ListGeofenceResponseEntry -> POSIX)
-> (ListGeofenceResponseEntry
    -> POSIX -> ListGeofenceResponseEntry)
-> Lens
     ListGeofenceResponseEntry ListGeofenceResponseEntry POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceResponseEntry' {POSIX
createTime :: POSIX
$sel:createTime:ListGeofenceResponseEntry' :: ListGeofenceResponseEntry -> POSIX
createTime} -> POSIX
createTime) (\s :: ListGeofenceResponseEntry
s@ListGeofenceResponseEntry' {} POSIX
a -> ListGeofenceResponseEntry
s {$sel:createTime:ListGeofenceResponseEntry' :: POSIX
createTime = POSIX
a} :: ListGeofenceResponseEntry) ((POSIX -> f POSIX)
 -> ListGeofenceResponseEntry -> f ListGeofenceResponseEntry)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListGeofenceResponseEntry
-> f ListGeofenceResponseEntry
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 identifier.
listGeofenceResponseEntry_geofenceId :: Lens.Lens' ListGeofenceResponseEntry Prelude.Text
listGeofenceResponseEntry_geofenceId :: (Text -> f Text)
-> ListGeofenceResponseEntry -> f ListGeofenceResponseEntry
listGeofenceResponseEntry_geofenceId = (ListGeofenceResponseEntry -> Text)
-> (ListGeofenceResponseEntry -> Text -> ListGeofenceResponseEntry)
-> Lens
     ListGeofenceResponseEntry ListGeofenceResponseEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceResponseEntry' {Text
geofenceId :: Text
$sel:geofenceId:ListGeofenceResponseEntry' :: ListGeofenceResponseEntry -> Text
geofenceId} -> Text
geofenceId) (\s :: ListGeofenceResponseEntry
s@ListGeofenceResponseEntry' {} Text
a -> ListGeofenceResponseEntry
s {$sel:geofenceId:ListGeofenceResponseEntry' :: Text
geofenceId = Text
a} :: ListGeofenceResponseEntry)

-- | Contains the geofence geometry details describing a polygon.
listGeofenceResponseEntry_geometry :: Lens.Lens' ListGeofenceResponseEntry GeofenceGeometry
listGeofenceResponseEntry_geometry :: (GeofenceGeometry -> f GeofenceGeometry)
-> ListGeofenceResponseEntry -> f ListGeofenceResponseEntry
listGeofenceResponseEntry_geometry = (ListGeofenceResponseEntry -> GeofenceGeometry)
-> (ListGeofenceResponseEntry
    -> GeofenceGeometry -> ListGeofenceResponseEntry)
-> Lens
     ListGeofenceResponseEntry
     ListGeofenceResponseEntry
     GeofenceGeometry
     GeofenceGeometry
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceResponseEntry' {GeofenceGeometry
geometry :: GeofenceGeometry
$sel:geometry:ListGeofenceResponseEntry' :: ListGeofenceResponseEntry -> GeofenceGeometry
geometry} -> GeofenceGeometry
geometry) (\s :: ListGeofenceResponseEntry
s@ListGeofenceResponseEntry' {} GeofenceGeometry
a -> ListGeofenceResponseEntry
s {$sel:geometry:ListGeofenceResponseEntry' :: GeofenceGeometry
geometry = GeofenceGeometry
a} :: ListGeofenceResponseEntry)

-- | Identifies the state of the geofence. A geofence will hold one of the
-- following states:
--
-- -   @ACTIVE@ — The geofence has been indexed by the system.
--
-- -   @PENDING@ — The geofence is being processed by the system.
--
-- -   @FAILED@ — The geofence failed to be indexed by the system.
--
-- -   @DELETED@ — The geofence has been deleted from the system index.
--
-- -   @DELETING@ — The geofence is being deleted from the system index.
listGeofenceResponseEntry_status :: Lens.Lens' ListGeofenceResponseEntry Prelude.Text
listGeofenceResponseEntry_status :: (Text -> f Text)
-> ListGeofenceResponseEntry -> f ListGeofenceResponseEntry
listGeofenceResponseEntry_status = (ListGeofenceResponseEntry -> Text)
-> (ListGeofenceResponseEntry -> Text -> ListGeofenceResponseEntry)
-> Lens
     ListGeofenceResponseEntry ListGeofenceResponseEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceResponseEntry' {Text
status :: Text
$sel:status:ListGeofenceResponseEntry' :: ListGeofenceResponseEntry -> Text
status} -> Text
status) (\s :: ListGeofenceResponseEntry
s@ListGeofenceResponseEntry' {} Text
a -> ListGeofenceResponseEntry
s {$sel:status:ListGeofenceResponseEntry' :: Text
status = Text
a} :: ListGeofenceResponseEntry)

-- | 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@
listGeofenceResponseEntry_updateTime :: Lens.Lens' ListGeofenceResponseEntry Prelude.UTCTime
listGeofenceResponseEntry_updateTime :: (UTCTime -> f UTCTime)
-> ListGeofenceResponseEntry -> f ListGeofenceResponseEntry
listGeofenceResponseEntry_updateTime = (ListGeofenceResponseEntry -> POSIX)
-> (ListGeofenceResponseEntry
    -> POSIX -> ListGeofenceResponseEntry)
-> Lens
     ListGeofenceResponseEntry ListGeofenceResponseEntry POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceResponseEntry' {POSIX
updateTime :: POSIX
$sel:updateTime:ListGeofenceResponseEntry' :: ListGeofenceResponseEntry -> POSIX
updateTime} -> POSIX
updateTime) (\s :: ListGeofenceResponseEntry
s@ListGeofenceResponseEntry' {} POSIX
a -> ListGeofenceResponseEntry
s {$sel:updateTime:ListGeofenceResponseEntry' :: POSIX
updateTime = POSIX
a} :: ListGeofenceResponseEntry) ((POSIX -> f POSIX)
 -> ListGeofenceResponseEntry -> f ListGeofenceResponseEntry)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListGeofenceResponseEntry
-> f ListGeofenceResponseEntry
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 ListGeofenceResponseEntry where
  parseJSON :: Value -> Parser ListGeofenceResponseEntry
parseJSON =
    String
-> (Object -> Parser ListGeofenceResponseEntry)
-> Value
-> Parser ListGeofenceResponseEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListGeofenceResponseEntry"
      ( \Object
x ->
          POSIX
-> Text
-> GeofenceGeometry
-> Text
-> POSIX
-> ListGeofenceResponseEntry
ListGeofenceResponseEntry'
            (POSIX
 -> Text
 -> GeofenceGeometry
 -> Text
 -> POSIX
 -> ListGeofenceResponseEntry)
-> Parser POSIX
-> Parser
     (Text
      -> GeofenceGeometry -> Text -> POSIX -> ListGeofenceResponseEntry)
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
   -> GeofenceGeometry -> Text -> POSIX -> ListGeofenceResponseEntry)
-> Parser Text
-> Parser
     (GeofenceGeometry -> Text -> POSIX -> ListGeofenceResponseEntry)
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
  (GeofenceGeometry -> Text -> POSIX -> ListGeofenceResponseEntry)
-> Parser GeofenceGeometry
-> Parser (Text -> POSIX -> ListGeofenceResponseEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser GeofenceGeometry
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Geometry")
            Parser (Text -> POSIX -> ListGeofenceResponseEntry)
-> Parser Text -> Parser (POSIX -> ListGeofenceResponseEntry)
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
"Status")
            Parser (POSIX -> ListGeofenceResponseEntry)
-> Parser POSIX -> Parser ListGeofenceResponseEntry
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 ListGeofenceResponseEntry

instance Prelude.NFData ListGeofenceResponseEntry