{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Rekognition.DetectFaces
-- 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)
--
-- Detects faces within an image that is provided as input.
--
-- @DetectFaces@ detects the 100 largest faces in the image. For each face
-- detected, the operation returns face details. These details include a
-- bounding box of the face, a confidence value (that the bounding box
-- contains a face), and a fixed set of attributes such as facial landmarks
-- (for example, coordinates of eye and mouth), presence of beard,
-- sunglasses, and so on.
--
-- The face-detection algorithm is most effective on frontal faces. For
-- non-frontal or obscured faces, the algorithm might not detect the faces
-- or might detect faces with lower confidence.
--
-- You pass the input image either as base64-encoded image bytes or as a
-- reference to an image in an Amazon S3 bucket. If you use the AWS CLI to
-- call Amazon Rekognition operations, passing image bytes is not
-- supported. The image must be either a PNG or JPEG formatted file.
--
-- This is a stateless API operation. That is, the operation does not
-- persist any data.
--
-- This operation requires permissions to perform the
-- @rekognition:DetectFaces@ action.
module Amazonka.Rekognition.DetectFaces
  ( -- * Creating a Request
    DetectFaces (..),
    newDetectFaces,

    -- * Request Lenses
    detectFaces_attributes,
    detectFaces_image,

    -- * Destructuring the Response
    DetectFacesResponse (..),
    newDetectFacesResponse,

    -- * Response Lenses
    detectFacesResponse_orientationCorrection,
    detectFacesResponse_faceDetails,
    detectFacesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDetectFaces' smart constructor.
data DetectFaces = DetectFaces'
  { -- | An array of facial attributes you want to be returned. This can be the
    -- default list of attributes or all attributes. If you don\'t specify a
    -- value for @Attributes@ or if you specify @[\"DEFAULT\"]@, the API
    -- returns the following subset of facial attributes: @BoundingBox@,
    -- @Confidence@, @Pose@, @Quality@, and @Landmarks@. If you provide
    -- @[\"ALL\"]@, all facial attributes are returned, but the operation takes
    -- longer to complete.
    --
    -- If you provide both, @[\"ALL\", \"DEFAULT\"]@, the service uses a
    -- logical AND operator to determine which attributes to return (in this
    -- case, all attributes).
    DetectFaces -> Maybe [Attribute]
attributes :: Prelude.Maybe [Attribute],
    -- | The input image as base64-encoded bytes or an S3 object. If you use the
    -- AWS CLI to call Amazon Rekognition operations, passing base64-encoded
    -- image bytes is not supported.
    --
    -- If you are using an AWS SDK to call Amazon Rekognition, you might not
    -- need to base64-encode image bytes passed using the @Bytes@ field. For
    -- more information, see Images in the Amazon Rekognition developer guide.
    DetectFaces -> Image
image :: Image
  }
  deriving (DetectFaces -> DetectFaces -> Bool
(DetectFaces -> DetectFaces -> Bool)
-> (DetectFaces -> DetectFaces -> Bool) -> Eq DetectFaces
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectFaces -> DetectFaces -> Bool
$c/= :: DetectFaces -> DetectFaces -> Bool
== :: DetectFaces -> DetectFaces -> Bool
$c== :: DetectFaces -> DetectFaces -> Bool
Prelude.Eq, ReadPrec [DetectFaces]
ReadPrec DetectFaces
Int -> ReadS DetectFaces
ReadS [DetectFaces]
(Int -> ReadS DetectFaces)
-> ReadS [DetectFaces]
-> ReadPrec DetectFaces
-> ReadPrec [DetectFaces]
-> Read DetectFaces
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectFaces]
$creadListPrec :: ReadPrec [DetectFaces]
readPrec :: ReadPrec DetectFaces
$creadPrec :: ReadPrec DetectFaces
readList :: ReadS [DetectFaces]
$creadList :: ReadS [DetectFaces]
readsPrec :: Int -> ReadS DetectFaces
$creadsPrec :: Int -> ReadS DetectFaces
Prelude.Read, Int -> DetectFaces -> ShowS
[DetectFaces] -> ShowS
DetectFaces -> String
(Int -> DetectFaces -> ShowS)
-> (DetectFaces -> String)
-> ([DetectFaces] -> ShowS)
-> Show DetectFaces
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectFaces] -> ShowS
$cshowList :: [DetectFaces] -> ShowS
show :: DetectFaces -> String
$cshow :: DetectFaces -> String
showsPrec :: Int -> DetectFaces -> ShowS
$cshowsPrec :: Int -> DetectFaces -> ShowS
Prelude.Show, (forall x. DetectFaces -> Rep DetectFaces x)
-> (forall x. Rep DetectFaces x -> DetectFaces)
-> Generic DetectFaces
forall x. Rep DetectFaces x -> DetectFaces
forall x. DetectFaces -> Rep DetectFaces x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetectFaces x -> DetectFaces
$cfrom :: forall x. DetectFaces -> Rep DetectFaces x
Prelude.Generic)

-- |
-- Create a value of 'DetectFaces' 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:
--
-- 'attributes', 'detectFaces_attributes' - An array of facial attributes you want to be returned. This can be the
-- default list of attributes or all attributes. If you don\'t specify a
-- value for @Attributes@ or if you specify @[\"DEFAULT\"]@, the API
-- returns the following subset of facial attributes: @BoundingBox@,
-- @Confidence@, @Pose@, @Quality@, and @Landmarks@. If you provide
-- @[\"ALL\"]@, all facial attributes are returned, but the operation takes
-- longer to complete.
--
-- If you provide both, @[\"ALL\", \"DEFAULT\"]@, the service uses a
-- logical AND operator to determine which attributes to return (in this
-- case, all attributes).
--
-- 'image', 'detectFaces_image' - The input image as base64-encoded bytes or an S3 object. If you use the
-- AWS CLI to call Amazon Rekognition operations, passing base64-encoded
-- image bytes is not supported.
--
-- If you are using an AWS SDK to call Amazon Rekognition, you might not
-- need to base64-encode image bytes passed using the @Bytes@ field. For
-- more information, see Images in the Amazon Rekognition developer guide.
newDetectFaces ::
  -- | 'image'
  Image ->
  DetectFaces
newDetectFaces :: Image -> DetectFaces
newDetectFaces Image
pImage_ =
  DetectFaces' :: Maybe [Attribute] -> Image -> DetectFaces
DetectFaces'
    { $sel:attributes:DetectFaces' :: Maybe [Attribute]
attributes = Maybe [Attribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:image:DetectFaces' :: Image
image = Image
pImage_
    }

-- | An array of facial attributes you want to be returned. This can be the
-- default list of attributes or all attributes. If you don\'t specify a
-- value for @Attributes@ or if you specify @[\"DEFAULT\"]@, the API
-- returns the following subset of facial attributes: @BoundingBox@,
-- @Confidence@, @Pose@, @Quality@, and @Landmarks@. If you provide
-- @[\"ALL\"]@, all facial attributes are returned, but the operation takes
-- longer to complete.
--
-- If you provide both, @[\"ALL\", \"DEFAULT\"]@, the service uses a
-- logical AND operator to determine which attributes to return (in this
-- case, all attributes).
detectFaces_attributes :: Lens.Lens' DetectFaces (Prelude.Maybe [Attribute])
detectFaces_attributes :: (Maybe [Attribute] -> f (Maybe [Attribute]))
-> DetectFaces -> f DetectFaces
detectFaces_attributes = (DetectFaces -> Maybe [Attribute])
-> (DetectFaces -> Maybe [Attribute] -> DetectFaces)
-> Lens
     DetectFaces DetectFaces (Maybe [Attribute]) (Maybe [Attribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectFaces' {Maybe [Attribute]
attributes :: Maybe [Attribute]
$sel:attributes:DetectFaces' :: DetectFaces -> Maybe [Attribute]
attributes} -> Maybe [Attribute]
attributes) (\s :: DetectFaces
s@DetectFaces' {} Maybe [Attribute]
a -> DetectFaces
s {$sel:attributes:DetectFaces' :: Maybe [Attribute]
attributes = Maybe [Attribute]
a} :: DetectFaces) ((Maybe [Attribute] -> f (Maybe [Attribute]))
 -> DetectFaces -> f DetectFaces)
-> ((Maybe [Attribute] -> f (Maybe [Attribute]))
    -> Maybe [Attribute] -> f (Maybe [Attribute]))
-> (Maybe [Attribute] -> f (Maybe [Attribute]))
-> DetectFaces
-> f DetectFaces
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attribute] [Attribute] [Attribute] [Attribute]
-> Iso
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Attribute] [Attribute] [Attribute] [Attribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The input image as base64-encoded bytes or an S3 object. If you use the
-- AWS CLI to call Amazon Rekognition operations, passing base64-encoded
-- image bytes is not supported.
--
-- If you are using an AWS SDK to call Amazon Rekognition, you might not
-- need to base64-encode image bytes passed using the @Bytes@ field. For
-- more information, see Images in the Amazon Rekognition developer guide.
detectFaces_image :: Lens.Lens' DetectFaces Image
detectFaces_image :: (Image -> f Image) -> DetectFaces -> f DetectFaces
detectFaces_image = (DetectFaces -> Image)
-> (DetectFaces -> Image -> DetectFaces)
-> Lens DetectFaces DetectFaces Image Image
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectFaces' {Image
image :: Image
$sel:image:DetectFaces' :: DetectFaces -> Image
image} -> Image
image) (\s :: DetectFaces
s@DetectFaces' {} Image
a -> DetectFaces
s {$sel:image:DetectFaces' :: Image
image = Image
a} :: DetectFaces)

instance Core.AWSRequest DetectFaces where
  type AWSResponse DetectFaces = DetectFacesResponse
  request :: DetectFaces -> Request DetectFaces
request = Service -> DetectFaces -> Request DetectFaces
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DetectFaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DetectFaces)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DetectFaces))
-> Logger
-> Service
-> Proxy DetectFaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DetectFaces)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe OrientationCorrection
-> Maybe [FaceDetail] -> Int -> DetectFacesResponse
DetectFacesResponse'
            (Maybe OrientationCorrection
 -> Maybe [FaceDetail] -> Int -> DetectFacesResponse)
-> Either String (Maybe OrientationCorrection)
-> Either String (Maybe [FaceDetail] -> Int -> DetectFacesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Key -> Either String (Maybe OrientationCorrection)
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"OrientationCorrection")
            Either String (Maybe [FaceDetail] -> Int -> DetectFacesResponse)
-> Either String (Maybe [FaceDetail])
-> Either String (Int -> DetectFacesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Key -> Either String (Maybe (Maybe [FaceDetail]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"FaceDetails" Either String (Maybe (Maybe [FaceDetail]))
-> Maybe [FaceDetail] -> Either String (Maybe [FaceDetail])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FaceDetail]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> DetectFacesResponse)
-> Either String Int -> Either String DetectFacesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DetectFaces

instance Prelude.NFData DetectFaces

instance Core.ToHeaders DetectFaces where
  toHeaders :: DetectFaces -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DetectFaces -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"RekognitionService.DetectFaces" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DetectFaces where
  toJSON :: DetectFaces -> Value
toJSON DetectFaces' {Maybe [Attribute]
Image
image :: Image
attributes :: Maybe [Attribute]
$sel:image:DetectFaces' :: DetectFaces -> Image
$sel:attributes:DetectFaces' :: DetectFaces -> Maybe [Attribute]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Attributes" Key -> [Attribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..=) ([Attribute] -> Pair) -> Maybe [Attribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Attribute]
attributes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Key
"Image" Key -> Image -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..= Image
image)
          ]
      )

instance Core.ToPath DetectFaces where
  toPath :: DetectFaces -> ByteString
toPath = ByteString -> DetectFaces -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DetectFaces where
  toQuery :: DetectFaces -> QueryString
toQuery = QueryString -> DetectFaces -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDetectFacesResponse' smart constructor.
data DetectFacesResponse = DetectFacesResponse'
  { -- | The value of @OrientationCorrection@ is always null.
    --
    -- If the input image is in .jpeg format, it might contain exchangeable
    -- image file format (Exif) metadata that includes the image\'s
    -- orientation. Amazon Rekognition uses this orientation information to
    -- perform image correction. The bounding box coordinates are translated to
    -- represent object locations after the orientation information in the Exif
    -- metadata is used to correct the image orientation. Images in .png format
    -- don\'t contain Exif metadata.
    --
    -- Amazon Rekognition doesn’t perform image correction for images in .png
    -- format and .jpeg images without orientation information in the image
    -- Exif metadata. The bounding box coordinates aren\'t translated and
    -- represent the object locations before the image is rotated.
    DetectFacesResponse -> Maybe OrientationCorrection
orientationCorrection :: Prelude.Maybe OrientationCorrection,
    -- | Details of each face found in the image.
    DetectFacesResponse -> Maybe [FaceDetail]
faceDetails :: Prelude.Maybe [FaceDetail],
    -- | The response's http status code.
    DetectFacesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DetectFacesResponse -> DetectFacesResponse -> Bool
(DetectFacesResponse -> DetectFacesResponse -> Bool)
-> (DetectFacesResponse -> DetectFacesResponse -> Bool)
-> Eq DetectFacesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectFacesResponse -> DetectFacesResponse -> Bool
$c/= :: DetectFacesResponse -> DetectFacesResponse -> Bool
== :: DetectFacesResponse -> DetectFacesResponse -> Bool
$c== :: DetectFacesResponse -> DetectFacesResponse -> Bool
Prelude.Eq, ReadPrec [DetectFacesResponse]
ReadPrec DetectFacesResponse
Int -> ReadS DetectFacesResponse
ReadS [DetectFacesResponse]
(Int -> ReadS DetectFacesResponse)
-> ReadS [DetectFacesResponse]
-> ReadPrec DetectFacesResponse
-> ReadPrec [DetectFacesResponse]
-> Read DetectFacesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectFacesResponse]
$creadListPrec :: ReadPrec [DetectFacesResponse]
readPrec :: ReadPrec DetectFacesResponse
$creadPrec :: ReadPrec DetectFacesResponse
readList :: ReadS [DetectFacesResponse]
$creadList :: ReadS [DetectFacesResponse]
readsPrec :: Int -> ReadS DetectFacesResponse
$creadsPrec :: Int -> ReadS DetectFacesResponse
Prelude.Read, Int -> DetectFacesResponse -> ShowS
[DetectFacesResponse] -> ShowS
DetectFacesResponse -> String
(Int -> DetectFacesResponse -> ShowS)
-> (DetectFacesResponse -> String)
-> ([DetectFacesResponse] -> ShowS)
-> Show DetectFacesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectFacesResponse] -> ShowS
$cshowList :: [DetectFacesResponse] -> ShowS
show :: DetectFacesResponse -> String
$cshow :: DetectFacesResponse -> String
showsPrec :: Int -> DetectFacesResponse -> ShowS
$cshowsPrec :: Int -> DetectFacesResponse -> ShowS
Prelude.Show, (forall x. DetectFacesResponse -> Rep DetectFacesResponse x)
-> (forall x. Rep DetectFacesResponse x -> DetectFacesResponse)
-> Generic DetectFacesResponse
forall x. Rep DetectFacesResponse x -> DetectFacesResponse
forall x. DetectFacesResponse -> Rep DetectFacesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetectFacesResponse x -> DetectFacesResponse
$cfrom :: forall x. DetectFacesResponse -> Rep DetectFacesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DetectFacesResponse' 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:
--
-- 'orientationCorrection', 'detectFacesResponse_orientationCorrection' - The value of @OrientationCorrection@ is always null.
--
-- If the input image is in .jpeg format, it might contain exchangeable
-- image file format (Exif) metadata that includes the image\'s
-- orientation. Amazon Rekognition uses this orientation information to
-- perform image correction. The bounding box coordinates are translated to
-- represent object locations after the orientation information in the Exif
-- metadata is used to correct the image orientation. Images in .png format
-- don\'t contain Exif metadata.
--
-- Amazon Rekognition doesn’t perform image correction for images in .png
-- format and .jpeg images without orientation information in the image
-- Exif metadata. The bounding box coordinates aren\'t translated and
-- represent the object locations before the image is rotated.
--
-- 'faceDetails', 'detectFacesResponse_faceDetails' - Details of each face found in the image.
--
-- 'httpStatus', 'detectFacesResponse_httpStatus' - The response's http status code.
newDetectFacesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DetectFacesResponse
newDetectFacesResponse :: Int -> DetectFacesResponse
newDetectFacesResponse Int
pHttpStatus_ =
  DetectFacesResponse' :: Maybe OrientationCorrection
-> Maybe [FaceDetail] -> Int -> DetectFacesResponse
DetectFacesResponse'
    { $sel:orientationCorrection:DetectFacesResponse' :: Maybe OrientationCorrection
orientationCorrection =
        Maybe OrientationCorrection
forall a. Maybe a
Prelude.Nothing,
      $sel:faceDetails:DetectFacesResponse' :: Maybe [FaceDetail]
faceDetails = Maybe [FaceDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DetectFacesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The value of @OrientationCorrection@ is always null.
--
-- If the input image is in .jpeg format, it might contain exchangeable
-- image file format (Exif) metadata that includes the image\'s
-- orientation. Amazon Rekognition uses this orientation information to
-- perform image correction. The bounding box coordinates are translated to
-- represent object locations after the orientation information in the Exif
-- metadata is used to correct the image orientation. Images in .png format
-- don\'t contain Exif metadata.
--
-- Amazon Rekognition doesn’t perform image correction for images in .png
-- format and .jpeg images without orientation information in the image
-- Exif metadata. The bounding box coordinates aren\'t translated and
-- represent the object locations before the image is rotated.
detectFacesResponse_orientationCorrection :: Lens.Lens' DetectFacesResponse (Prelude.Maybe OrientationCorrection)
detectFacesResponse_orientationCorrection :: (Maybe OrientationCorrection -> f (Maybe OrientationCorrection))
-> DetectFacesResponse -> f DetectFacesResponse
detectFacesResponse_orientationCorrection = (DetectFacesResponse -> Maybe OrientationCorrection)
-> (DetectFacesResponse
    -> Maybe OrientationCorrection -> DetectFacesResponse)
-> Lens
     DetectFacesResponse
     DetectFacesResponse
     (Maybe OrientationCorrection)
     (Maybe OrientationCorrection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectFacesResponse' {Maybe OrientationCorrection
orientationCorrection :: Maybe OrientationCorrection
$sel:orientationCorrection:DetectFacesResponse' :: DetectFacesResponse -> Maybe OrientationCorrection
orientationCorrection} -> Maybe OrientationCorrection
orientationCorrection) (\s :: DetectFacesResponse
s@DetectFacesResponse' {} Maybe OrientationCorrection
a -> DetectFacesResponse
s {$sel:orientationCorrection:DetectFacesResponse' :: Maybe OrientationCorrection
orientationCorrection = Maybe OrientationCorrection
a} :: DetectFacesResponse)

-- | Details of each face found in the image.
detectFacesResponse_faceDetails :: Lens.Lens' DetectFacesResponse (Prelude.Maybe [FaceDetail])
detectFacesResponse_faceDetails :: (Maybe [FaceDetail] -> f (Maybe [FaceDetail]))
-> DetectFacesResponse -> f DetectFacesResponse
detectFacesResponse_faceDetails = (DetectFacesResponse -> Maybe [FaceDetail])
-> (DetectFacesResponse
    -> Maybe [FaceDetail] -> DetectFacesResponse)
-> Lens
     DetectFacesResponse
     DetectFacesResponse
     (Maybe [FaceDetail])
     (Maybe [FaceDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectFacesResponse' {Maybe [FaceDetail]
faceDetails :: Maybe [FaceDetail]
$sel:faceDetails:DetectFacesResponse' :: DetectFacesResponse -> Maybe [FaceDetail]
faceDetails} -> Maybe [FaceDetail]
faceDetails) (\s :: DetectFacesResponse
s@DetectFacesResponse' {} Maybe [FaceDetail]
a -> DetectFacesResponse
s {$sel:faceDetails:DetectFacesResponse' :: Maybe [FaceDetail]
faceDetails = Maybe [FaceDetail]
a} :: DetectFacesResponse) ((Maybe [FaceDetail] -> f (Maybe [FaceDetail]))
 -> DetectFacesResponse -> f DetectFacesResponse)
-> ((Maybe [FaceDetail] -> f (Maybe [FaceDetail]))
    -> Maybe [FaceDetail] -> f (Maybe [FaceDetail]))
-> (Maybe [FaceDetail] -> f (Maybe [FaceDetail]))
-> DetectFacesResponse
-> f DetectFacesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [FaceDetail] [FaceDetail] [FaceDetail] [FaceDetail]
-> Iso
     (Maybe [FaceDetail])
     (Maybe [FaceDetail])
     (Maybe [FaceDetail])
     (Maybe [FaceDetail])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [FaceDetail] [FaceDetail] [FaceDetail] [FaceDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
detectFacesResponse_httpStatus :: Lens.Lens' DetectFacesResponse Prelude.Int
detectFacesResponse_httpStatus :: (Int -> f Int) -> DetectFacesResponse -> f DetectFacesResponse
detectFacesResponse_httpStatus = (DetectFacesResponse -> Int)
-> (DetectFacesResponse -> Int -> DetectFacesResponse)
-> Lens DetectFacesResponse DetectFacesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectFacesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DetectFacesResponse' :: DetectFacesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DetectFacesResponse
s@DetectFacesResponse' {} Int
a -> DetectFacesResponse
s {$sel:httpStatus:DetectFacesResponse' :: Int
httpStatus = Int
a} :: DetectFacesResponse)

instance Prelude.NFData DetectFacesResponse