{-# 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-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.ListGeofenceResponseEntry 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.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 -> ISO8601
createTime :: Data.ISO8601,
    -- | The geofence identifier.
    ListGeofenceResponseEntry -> Text
geofenceId :: Prelude.Text,
    -- | Contains the geofence geometry details describing a polygon or a circle.
    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 -> ISO8601
updateTime :: Data.ISO8601
  }
  deriving (ListGeofenceResponseEntry -> ListGeofenceResponseEntry -> Bool
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
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.
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 or a circle.
--
-- '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'
      { $sel:createTime:ListGeofenceResponseEntry' :: ISO8601
createTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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' :: 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@
listGeofenceResponseEntry_createTime :: Lens.Lens' ListGeofenceResponseEntry Prelude.UTCTime
listGeofenceResponseEntry_createTime :: Lens' ListGeofenceResponseEntry UTCTime
listGeofenceResponseEntry_createTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceResponseEntry' {ISO8601
createTime :: ISO8601
$sel:createTime:ListGeofenceResponseEntry' :: ListGeofenceResponseEntry -> ISO8601
createTime} -> ISO8601
createTime) (\s :: ListGeofenceResponseEntry
s@ListGeofenceResponseEntry' {} ISO8601
a -> ListGeofenceResponseEntry
s {$sel:createTime:ListGeofenceResponseEntry' :: ISO8601
createTime = ISO8601
a} :: ListGeofenceResponseEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The geofence identifier.
listGeofenceResponseEntry_geofenceId :: Lens.Lens' ListGeofenceResponseEntry Prelude.Text
listGeofenceResponseEntry_geofenceId :: Lens' ListGeofenceResponseEntry Text
listGeofenceResponseEntry_geofenceId = 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 or a circle.
listGeofenceResponseEntry_geometry :: Lens.Lens' ListGeofenceResponseEntry GeofenceGeometry
listGeofenceResponseEntry_geometry :: Lens' ListGeofenceResponseEntry GeofenceGeometry
listGeofenceResponseEntry_geometry = 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 :: Lens' ListGeofenceResponseEntry Text
listGeofenceResponseEntry_status = 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 :: Lens' ListGeofenceResponseEntry UTCTime
listGeofenceResponseEntry_updateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceResponseEntry' {ISO8601
updateTime :: ISO8601
$sel:updateTime:ListGeofenceResponseEntry' :: ListGeofenceResponseEntry -> ISO8601
updateTime} -> ISO8601
updateTime) (\s :: ListGeofenceResponseEntry
s@ListGeofenceResponseEntry' {} ISO8601
a -> ListGeofenceResponseEntry
s {$sel:updateTime:ListGeofenceResponseEntry' :: ISO8601
updateTime = ISO8601
a} :: ListGeofenceResponseEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

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