{-# 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 #-}
module Amazonka.Rekognition.Types.RegionOfInterest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.BoundingBox
data RegionOfInterest = RegionOfInterest'
{
RegionOfInterest -> Maybe BoundingBox
boundingBox :: Prelude.Maybe BoundingBox
}
deriving (RegionOfInterest -> RegionOfInterest -> Bool
(RegionOfInterest -> RegionOfInterest -> Bool)
-> (RegionOfInterest -> RegionOfInterest -> Bool)
-> Eq RegionOfInterest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegionOfInterest -> RegionOfInterest -> Bool
$c/= :: RegionOfInterest -> RegionOfInterest -> Bool
== :: RegionOfInterest -> RegionOfInterest -> Bool
$c== :: RegionOfInterest -> RegionOfInterest -> Bool
Prelude.Eq, ReadPrec [RegionOfInterest]
ReadPrec RegionOfInterest
Int -> ReadS RegionOfInterest
ReadS [RegionOfInterest]
(Int -> ReadS RegionOfInterest)
-> ReadS [RegionOfInterest]
-> ReadPrec RegionOfInterest
-> ReadPrec [RegionOfInterest]
-> Read RegionOfInterest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegionOfInterest]
$creadListPrec :: ReadPrec [RegionOfInterest]
readPrec :: ReadPrec RegionOfInterest
$creadPrec :: ReadPrec RegionOfInterest
readList :: ReadS [RegionOfInterest]
$creadList :: ReadS [RegionOfInterest]
readsPrec :: Int -> ReadS RegionOfInterest
$creadsPrec :: Int -> ReadS RegionOfInterest
Prelude.Read, Int -> RegionOfInterest -> ShowS
[RegionOfInterest] -> ShowS
RegionOfInterest -> String
(Int -> RegionOfInterest -> ShowS)
-> (RegionOfInterest -> String)
-> ([RegionOfInterest] -> ShowS)
-> Show RegionOfInterest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegionOfInterest] -> ShowS
$cshowList :: [RegionOfInterest] -> ShowS
show :: RegionOfInterest -> String
$cshow :: RegionOfInterest -> String
showsPrec :: Int -> RegionOfInterest -> ShowS
$cshowsPrec :: Int -> RegionOfInterest -> ShowS
Prelude.Show, (forall x. RegionOfInterest -> Rep RegionOfInterest x)
-> (forall x. Rep RegionOfInterest x -> RegionOfInterest)
-> Generic RegionOfInterest
forall x. Rep RegionOfInterest x -> RegionOfInterest
forall x. RegionOfInterest -> Rep RegionOfInterest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegionOfInterest x -> RegionOfInterest
$cfrom :: forall x. RegionOfInterest -> Rep RegionOfInterest x
Prelude.Generic)
newRegionOfInterest ::
RegionOfInterest
newRegionOfInterest :: RegionOfInterest
newRegionOfInterest =
RegionOfInterest' :: Maybe BoundingBox -> RegionOfInterest
RegionOfInterest' {$sel:boundingBox:RegionOfInterest' :: Maybe BoundingBox
boundingBox = Maybe BoundingBox
forall a. Maybe a
Prelude.Nothing}
regionOfInterest_boundingBox :: Lens.Lens' RegionOfInterest (Prelude.Maybe BoundingBox)
regionOfInterest_boundingBox :: (Maybe BoundingBox -> f (Maybe BoundingBox))
-> RegionOfInterest -> f RegionOfInterest
regionOfInterest_boundingBox = (RegionOfInterest -> Maybe BoundingBox)
-> (RegionOfInterest -> Maybe BoundingBox -> RegionOfInterest)
-> Lens
RegionOfInterest
RegionOfInterest
(Maybe BoundingBox)
(Maybe BoundingBox)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegionOfInterest' {Maybe BoundingBox
boundingBox :: Maybe BoundingBox
$sel:boundingBox:RegionOfInterest' :: RegionOfInterest -> Maybe BoundingBox
boundingBox} -> Maybe BoundingBox
boundingBox) (\s :: RegionOfInterest
s@RegionOfInterest' {} Maybe BoundingBox
a -> RegionOfInterest
s {$sel:boundingBox:RegionOfInterest' :: Maybe BoundingBox
boundingBox = Maybe BoundingBox
a} :: RegionOfInterest)
instance Prelude.Hashable RegionOfInterest
instance Prelude.NFData RegionOfInterest
instance Core.ToJSON RegionOfInterest where
toJSON :: RegionOfInterest -> Value
toJSON RegionOfInterest' {Maybe BoundingBox
boundingBox :: Maybe BoundingBox
$sel:boundingBox:RegionOfInterest' :: RegionOfInterest -> Maybe BoundingBox
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"BoundingBox" Text -> BoundingBox -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BoundingBox -> Pair) -> Maybe BoundingBox -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BoundingBox
boundingBox]
)