{-# 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.DetectProtectiveEquipment
-- 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 Personal Protective Equipment (PPE) worn by people detected in
-- an image. Amazon Rekognition can detect the following types of PPE.
--
-- -   Face cover
--
-- -   Hand cover
--
-- -   Head cover
--
-- You pass the input image as base64-encoded image bytes or as a reference
-- to an image in an Amazon S3 bucket. The image must be either a PNG or
-- JPG formatted file.
--
-- @DetectProtectiveEquipment@ detects PPE worn by up to 15 persons
-- detected in an image.
--
-- For each person detected in the image the API returns an array of body
-- parts (face, head, left-hand, right-hand). For each body part, an array
-- of detected items of PPE is returned, including an indicator of whether
-- or not the PPE covers the body part. The API returns the confidence it
-- has in each detection (person, PPE, body part and body part coverage).
-- It also returns a bounding box (BoundingBox) for each detected person
-- and each detected item of PPE.
--
-- You can optionally request a summary of detected PPE items with the
-- @SummarizationAttributes@ input parameter. The summary provides the
-- following information.
--
-- -   The persons detected as wearing all of the types of PPE that you
--     specify.
--
-- -   The persons detected as not wearing all of the types PPE that you
--     specify.
--
-- -   The persons detected where PPE adornment could not be determined.
--
-- This is a stateless API operation. That is, the operation does not
-- persist any data.
--
-- This operation requires permissions to perform the
-- @rekognition:DetectProtectiveEquipment@ action.
module Amazonka.Rekognition.DetectProtectiveEquipment
  ( -- * Creating a Request
    DetectProtectiveEquipment (..),
    newDetectProtectiveEquipment,

    -- * Request Lenses
    detectProtectiveEquipment_summarizationAttributes,
    detectProtectiveEquipment_image,

    -- * Destructuring the Response
    DetectProtectiveEquipmentResponse (..),
    newDetectProtectiveEquipmentResponse,

    -- * Response Lenses
    detectProtectiveEquipmentResponse_summary,
    detectProtectiveEquipmentResponse_protectiveEquipmentModelVersion,
    detectProtectiveEquipmentResponse_persons,
    detectProtectiveEquipmentResponse_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:/ 'newDetectProtectiveEquipment' smart constructor.
data DetectProtectiveEquipment = DetectProtectiveEquipment'
  { -- | An array of PPE types that you want to summarize.
    DetectProtectiveEquipment
-> Maybe ProtectiveEquipmentSummarizationAttributes
summarizationAttributes :: Prelude.Maybe ProtectiveEquipmentSummarizationAttributes,
    -- | The image in which you want to detect PPE on detected persons. The image
    -- can be passed as image bytes or you can reference an image stored in an
    -- Amazon S3 bucket.
    DetectProtectiveEquipment -> Image
image :: Image
  }
  deriving (DetectProtectiveEquipment -> DetectProtectiveEquipment -> Bool
(DetectProtectiveEquipment -> DetectProtectiveEquipment -> Bool)
-> (DetectProtectiveEquipment -> DetectProtectiveEquipment -> Bool)
-> Eq DetectProtectiveEquipment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectProtectiveEquipment -> DetectProtectiveEquipment -> Bool
$c/= :: DetectProtectiveEquipment -> DetectProtectiveEquipment -> Bool
== :: DetectProtectiveEquipment -> DetectProtectiveEquipment -> Bool
$c== :: DetectProtectiveEquipment -> DetectProtectiveEquipment -> Bool
Prelude.Eq, ReadPrec [DetectProtectiveEquipment]
ReadPrec DetectProtectiveEquipment
Int -> ReadS DetectProtectiveEquipment
ReadS [DetectProtectiveEquipment]
(Int -> ReadS DetectProtectiveEquipment)
-> ReadS [DetectProtectiveEquipment]
-> ReadPrec DetectProtectiveEquipment
-> ReadPrec [DetectProtectiveEquipment]
-> Read DetectProtectiveEquipment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectProtectiveEquipment]
$creadListPrec :: ReadPrec [DetectProtectiveEquipment]
readPrec :: ReadPrec DetectProtectiveEquipment
$creadPrec :: ReadPrec DetectProtectiveEquipment
readList :: ReadS [DetectProtectiveEquipment]
$creadList :: ReadS [DetectProtectiveEquipment]
readsPrec :: Int -> ReadS DetectProtectiveEquipment
$creadsPrec :: Int -> ReadS DetectProtectiveEquipment
Prelude.Read, Int -> DetectProtectiveEquipment -> ShowS
[DetectProtectiveEquipment] -> ShowS
DetectProtectiveEquipment -> String
(Int -> DetectProtectiveEquipment -> ShowS)
-> (DetectProtectiveEquipment -> String)
-> ([DetectProtectiveEquipment] -> ShowS)
-> Show DetectProtectiveEquipment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectProtectiveEquipment] -> ShowS
$cshowList :: [DetectProtectiveEquipment] -> ShowS
show :: DetectProtectiveEquipment -> String
$cshow :: DetectProtectiveEquipment -> String
showsPrec :: Int -> DetectProtectiveEquipment -> ShowS
$cshowsPrec :: Int -> DetectProtectiveEquipment -> ShowS
Prelude.Show, (forall x.
 DetectProtectiveEquipment -> Rep DetectProtectiveEquipment x)
-> (forall x.
    Rep DetectProtectiveEquipment x -> DetectProtectiveEquipment)
-> Generic DetectProtectiveEquipment
forall x.
Rep DetectProtectiveEquipment x -> DetectProtectiveEquipment
forall x.
DetectProtectiveEquipment -> Rep DetectProtectiveEquipment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectProtectiveEquipment x -> DetectProtectiveEquipment
$cfrom :: forall x.
DetectProtectiveEquipment -> Rep DetectProtectiveEquipment x
Prelude.Generic)

-- |
-- Create a value of 'DetectProtectiveEquipment' 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:
--
-- 'summarizationAttributes', 'detectProtectiveEquipment_summarizationAttributes' - An array of PPE types that you want to summarize.
--
-- 'image', 'detectProtectiveEquipment_image' - The image in which you want to detect PPE on detected persons. The image
-- can be passed as image bytes or you can reference an image stored in an
-- Amazon S3 bucket.
newDetectProtectiveEquipment ::
  -- | 'image'
  Image ->
  DetectProtectiveEquipment
newDetectProtectiveEquipment :: Image -> DetectProtectiveEquipment
newDetectProtectiveEquipment Image
pImage_ =
  DetectProtectiveEquipment' :: Maybe ProtectiveEquipmentSummarizationAttributes
-> Image -> DetectProtectiveEquipment
DetectProtectiveEquipment'
    { $sel:summarizationAttributes:DetectProtectiveEquipment' :: Maybe ProtectiveEquipmentSummarizationAttributes
summarizationAttributes =
        Maybe ProtectiveEquipmentSummarizationAttributes
forall a. Maybe a
Prelude.Nothing,
      $sel:image:DetectProtectiveEquipment' :: Image
image = Image
pImage_
    }

-- | An array of PPE types that you want to summarize.
detectProtectiveEquipment_summarizationAttributes :: Lens.Lens' DetectProtectiveEquipment (Prelude.Maybe ProtectiveEquipmentSummarizationAttributes)
detectProtectiveEquipment_summarizationAttributes :: (Maybe ProtectiveEquipmentSummarizationAttributes
 -> f (Maybe ProtectiveEquipmentSummarizationAttributes))
-> DetectProtectiveEquipment -> f DetectProtectiveEquipment
detectProtectiveEquipment_summarizationAttributes = (DetectProtectiveEquipment
 -> Maybe ProtectiveEquipmentSummarizationAttributes)
-> (DetectProtectiveEquipment
    -> Maybe ProtectiveEquipmentSummarizationAttributes
    -> DetectProtectiveEquipment)
-> Lens
     DetectProtectiveEquipment
     DetectProtectiveEquipment
     (Maybe ProtectiveEquipmentSummarizationAttributes)
     (Maybe ProtectiveEquipmentSummarizationAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectProtectiveEquipment' {Maybe ProtectiveEquipmentSummarizationAttributes
summarizationAttributes :: Maybe ProtectiveEquipmentSummarizationAttributes
$sel:summarizationAttributes:DetectProtectiveEquipment' :: DetectProtectiveEquipment
-> Maybe ProtectiveEquipmentSummarizationAttributes
summarizationAttributes} -> Maybe ProtectiveEquipmentSummarizationAttributes
summarizationAttributes) (\s :: DetectProtectiveEquipment
s@DetectProtectiveEquipment' {} Maybe ProtectiveEquipmentSummarizationAttributes
a -> DetectProtectiveEquipment
s {$sel:summarizationAttributes:DetectProtectiveEquipment' :: Maybe ProtectiveEquipmentSummarizationAttributes
summarizationAttributes = Maybe ProtectiveEquipmentSummarizationAttributes
a} :: DetectProtectiveEquipment)

-- | The image in which you want to detect PPE on detected persons. The image
-- can be passed as image bytes or you can reference an image stored in an
-- Amazon S3 bucket.
detectProtectiveEquipment_image :: Lens.Lens' DetectProtectiveEquipment Image
detectProtectiveEquipment_image :: (Image -> f Image)
-> DetectProtectiveEquipment -> f DetectProtectiveEquipment
detectProtectiveEquipment_image = (DetectProtectiveEquipment -> Image)
-> (DetectProtectiveEquipment
    -> Image -> DetectProtectiveEquipment)
-> Lens
     DetectProtectiveEquipment DetectProtectiveEquipment Image Image
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectProtectiveEquipment' {Image
image :: Image
$sel:image:DetectProtectiveEquipment' :: DetectProtectiveEquipment -> Image
image} -> Image
image) (\s :: DetectProtectiveEquipment
s@DetectProtectiveEquipment' {} Image
a -> DetectProtectiveEquipment
s {$sel:image:DetectProtectiveEquipment' :: Image
image = Image
a} :: DetectProtectiveEquipment)

instance Core.AWSRequest DetectProtectiveEquipment where
  type
    AWSResponse DetectProtectiveEquipment =
      DetectProtectiveEquipmentResponse
  request :: DetectProtectiveEquipment -> Request DetectProtectiveEquipment
request = Service
-> DetectProtectiveEquipment -> Request DetectProtectiveEquipment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DetectProtectiveEquipment
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DetectProtectiveEquipment)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DetectProtectiveEquipment))
-> Logger
-> Service
-> Proxy DetectProtectiveEquipment
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DetectProtectiveEquipment)))
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 ProtectiveEquipmentSummary
-> Maybe Text
-> Maybe [ProtectiveEquipmentPerson]
-> Int
-> DetectProtectiveEquipmentResponse
DetectProtectiveEquipmentResponse'
            (Maybe ProtectiveEquipmentSummary
 -> Maybe Text
 -> Maybe [ProtectiveEquipmentPerson]
 -> Int
 -> DetectProtectiveEquipmentResponse)
-> Either String (Maybe ProtectiveEquipmentSummary)
-> Either
     String
     (Maybe Text
      -> Maybe [ProtectiveEquipmentPerson]
      -> Int
      -> DetectProtectiveEquipmentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ProtectiveEquipmentSummary)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Summary")
            Either
  String
  (Maybe Text
   -> Maybe [ProtectiveEquipmentPerson]
   -> Int
   -> DetectProtectiveEquipmentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ProtectiveEquipmentPerson]
      -> Int -> DetectProtectiveEquipmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProtectiveEquipmentModelVersion")
            Either
  String
  (Maybe [ProtectiveEquipmentPerson]
   -> Int -> DetectProtectiveEquipmentResponse)
-> Either String (Maybe [ProtectiveEquipmentPerson])
-> Either String (Int -> DetectProtectiveEquipmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe (Maybe [ProtectiveEquipmentPerson]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Persons" Either String (Maybe (Maybe [ProtectiveEquipmentPerson]))
-> Maybe [ProtectiveEquipmentPerson]
-> Either String (Maybe [ProtectiveEquipmentPerson])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ProtectiveEquipmentPerson]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> DetectProtectiveEquipmentResponse)
-> Either String Int
-> Either String DetectProtectiveEquipmentResponse
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 DetectProtectiveEquipment

instance Prelude.NFData DetectProtectiveEquipment

instance Core.ToHeaders DetectProtectiveEquipment where
  toHeaders :: DetectProtectiveEquipment -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DetectProtectiveEquipment -> 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.DetectProtectiveEquipment" ::
                          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 DetectProtectiveEquipment where
  toJSON :: DetectProtectiveEquipment -> Value
toJSON DetectProtectiveEquipment' {Maybe ProtectiveEquipmentSummarizationAttributes
Image
image :: Image
summarizationAttributes :: Maybe ProtectiveEquipmentSummarizationAttributes
$sel:image:DetectProtectiveEquipment' :: DetectProtectiveEquipment -> Image
$sel:summarizationAttributes:DetectProtectiveEquipment' :: DetectProtectiveEquipment
-> Maybe ProtectiveEquipmentSummarizationAttributes
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SummarizationAttributes" Text -> ProtectiveEquipmentSummarizationAttributes -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ProtectiveEquipmentSummarizationAttributes -> Pair)
-> Maybe ProtectiveEquipmentSummarizationAttributes -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProtectiveEquipmentSummarizationAttributes
summarizationAttributes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Image" Text -> Image -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Image
image)
          ]
      )

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

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

-- | /See:/ 'newDetectProtectiveEquipmentResponse' smart constructor.
data DetectProtectiveEquipmentResponse = DetectProtectiveEquipmentResponse'
  { -- | Summary information for the types of PPE specified in the
    -- @SummarizationAttributes@ input parameter.
    DetectProtectiveEquipmentResponse
-> Maybe ProtectiveEquipmentSummary
summary :: Prelude.Maybe ProtectiveEquipmentSummary,
    -- | The version number of the PPE detection model used to detect PPE in the
    -- image.
    DetectProtectiveEquipmentResponse -> Maybe Text
protectiveEquipmentModelVersion :: Prelude.Maybe Prelude.Text,
    -- | An array of persons detected in the image (including persons not wearing
    -- PPE).
    DetectProtectiveEquipmentResponse
-> Maybe [ProtectiveEquipmentPerson]
persons :: Prelude.Maybe [ProtectiveEquipmentPerson],
    -- | The response's http status code.
    DetectProtectiveEquipmentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DetectProtectiveEquipmentResponse
-> DetectProtectiveEquipmentResponse -> Bool
(DetectProtectiveEquipmentResponse
 -> DetectProtectiveEquipmentResponse -> Bool)
-> (DetectProtectiveEquipmentResponse
    -> DetectProtectiveEquipmentResponse -> Bool)
-> Eq DetectProtectiveEquipmentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectProtectiveEquipmentResponse
-> DetectProtectiveEquipmentResponse -> Bool
$c/= :: DetectProtectiveEquipmentResponse
-> DetectProtectiveEquipmentResponse -> Bool
== :: DetectProtectiveEquipmentResponse
-> DetectProtectiveEquipmentResponse -> Bool
$c== :: DetectProtectiveEquipmentResponse
-> DetectProtectiveEquipmentResponse -> Bool
Prelude.Eq, ReadPrec [DetectProtectiveEquipmentResponse]
ReadPrec DetectProtectiveEquipmentResponse
Int -> ReadS DetectProtectiveEquipmentResponse
ReadS [DetectProtectiveEquipmentResponse]
(Int -> ReadS DetectProtectiveEquipmentResponse)
-> ReadS [DetectProtectiveEquipmentResponse]
-> ReadPrec DetectProtectiveEquipmentResponse
-> ReadPrec [DetectProtectiveEquipmentResponse]
-> Read DetectProtectiveEquipmentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectProtectiveEquipmentResponse]
$creadListPrec :: ReadPrec [DetectProtectiveEquipmentResponse]
readPrec :: ReadPrec DetectProtectiveEquipmentResponse
$creadPrec :: ReadPrec DetectProtectiveEquipmentResponse
readList :: ReadS [DetectProtectiveEquipmentResponse]
$creadList :: ReadS [DetectProtectiveEquipmentResponse]
readsPrec :: Int -> ReadS DetectProtectiveEquipmentResponse
$creadsPrec :: Int -> ReadS DetectProtectiveEquipmentResponse
Prelude.Read, Int -> DetectProtectiveEquipmentResponse -> ShowS
[DetectProtectiveEquipmentResponse] -> ShowS
DetectProtectiveEquipmentResponse -> String
(Int -> DetectProtectiveEquipmentResponse -> ShowS)
-> (DetectProtectiveEquipmentResponse -> String)
-> ([DetectProtectiveEquipmentResponse] -> ShowS)
-> Show DetectProtectiveEquipmentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectProtectiveEquipmentResponse] -> ShowS
$cshowList :: [DetectProtectiveEquipmentResponse] -> ShowS
show :: DetectProtectiveEquipmentResponse -> String
$cshow :: DetectProtectiveEquipmentResponse -> String
showsPrec :: Int -> DetectProtectiveEquipmentResponse -> ShowS
$cshowsPrec :: Int -> DetectProtectiveEquipmentResponse -> ShowS
Prelude.Show, (forall x.
 DetectProtectiveEquipmentResponse
 -> Rep DetectProtectiveEquipmentResponse x)
-> (forall x.
    Rep DetectProtectiveEquipmentResponse x
    -> DetectProtectiveEquipmentResponse)
-> Generic DetectProtectiveEquipmentResponse
forall x.
Rep DetectProtectiveEquipmentResponse x
-> DetectProtectiveEquipmentResponse
forall x.
DetectProtectiveEquipmentResponse
-> Rep DetectProtectiveEquipmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectProtectiveEquipmentResponse x
-> DetectProtectiveEquipmentResponse
$cfrom :: forall x.
DetectProtectiveEquipmentResponse
-> Rep DetectProtectiveEquipmentResponse x
Prelude.Generic)

-- |
-- Create a value of 'DetectProtectiveEquipmentResponse' 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:
--
-- 'summary', 'detectProtectiveEquipmentResponse_summary' - Summary information for the types of PPE specified in the
-- @SummarizationAttributes@ input parameter.
--
-- 'protectiveEquipmentModelVersion', 'detectProtectiveEquipmentResponse_protectiveEquipmentModelVersion' - The version number of the PPE detection model used to detect PPE in the
-- image.
--
-- 'persons', 'detectProtectiveEquipmentResponse_persons' - An array of persons detected in the image (including persons not wearing
-- PPE).
--
-- 'httpStatus', 'detectProtectiveEquipmentResponse_httpStatus' - The response's http status code.
newDetectProtectiveEquipmentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DetectProtectiveEquipmentResponse
newDetectProtectiveEquipmentResponse :: Int -> DetectProtectiveEquipmentResponse
newDetectProtectiveEquipmentResponse Int
pHttpStatus_ =
  DetectProtectiveEquipmentResponse' :: Maybe ProtectiveEquipmentSummary
-> Maybe Text
-> Maybe [ProtectiveEquipmentPerson]
-> Int
-> DetectProtectiveEquipmentResponse
DetectProtectiveEquipmentResponse'
    { $sel:summary:DetectProtectiveEquipmentResponse' :: Maybe ProtectiveEquipmentSummary
summary =
        Maybe ProtectiveEquipmentSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:protectiveEquipmentModelVersion:DetectProtectiveEquipmentResponse' :: Maybe Text
protectiveEquipmentModelVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:persons:DetectProtectiveEquipmentResponse' :: Maybe [ProtectiveEquipmentPerson]
persons = Maybe [ProtectiveEquipmentPerson]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DetectProtectiveEquipmentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Summary information for the types of PPE specified in the
-- @SummarizationAttributes@ input parameter.
detectProtectiveEquipmentResponse_summary :: Lens.Lens' DetectProtectiveEquipmentResponse (Prelude.Maybe ProtectiveEquipmentSummary)
detectProtectiveEquipmentResponse_summary :: (Maybe ProtectiveEquipmentSummary
 -> f (Maybe ProtectiveEquipmentSummary))
-> DetectProtectiveEquipmentResponse
-> f DetectProtectiveEquipmentResponse
detectProtectiveEquipmentResponse_summary = (DetectProtectiveEquipmentResponse
 -> Maybe ProtectiveEquipmentSummary)
-> (DetectProtectiveEquipmentResponse
    -> Maybe ProtectiveEquipmentSummary
    -> DetectProtectiveEquipmentResponse)
-> Lens
     DetectProtectiveEquipmentResponse
     DetectProtectiveEquipmentResponse
     (Maybe ProtectiveEquipmentSummary)
     (Maybe ProtectiveEquipmentSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectProtectiveEquipmentResponse' {Maybe ProtectiveEquipmentSummary
summary :: Maybe ProtectiveEquipmentSummary
$sel:summary:DetectProtectiveEquipmentResponse' :: DetectProtectiveEquipmentResponse
-> Maybe ProtectiveEquipmentSummary
summary} -> Maybe ProtectiveEquipmentSummary
summary) (\s :: DetectProtectiveEquipmentResponse
s@DetectProtectiveEquipmentResponse' {} Maybe ProtectiveEquipmentSummary
a -> DetectProtectiveEquipmentResponse
s {$sel:summary:DetectProtectiveEquipmentResponse' :: Maybe ProtectiveEquipmentSummary
summary = Maybe ProtectiveEquipmentSummary
a} :: DetectProtectiveEquipmentResponse)

-- | The version number of the PPE detection model used to detect PPE in the
-- image.
detectProtectiveEquipmentResponse_protectiveEquipmentModelVersion :: Lens.Lens' DetectProtectiveEquipmentResponse (Prelude.Maybe Prelude.Text)
detectProtectiveEquipmentResponse_protectiveEquipmentModelVersion :: (Maybe Text -> f (Maybe Text))
-> DetectProtectiveEquipmentResponse
-> f DetectProtectiveEquipmentResponse
detectProtectiveEquipmentResponse_protectiveEquipmentModelVersion = (DetectProtectiveEquipmentResponse -> Maybe Text)
-> (DetectProtectiveEquipmentResponse
    -> Maybe Text -> DetectProtectiveEquipmentResponse)
-> Lens
     DetectProtectiveEquipmentResponse
     DetectProtectiveEquipmentResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectProtectiveEquipmentResponse' {Maybe Text
protectiveEquipmentModelVersion :: Maybe Text
$sel:protectiveEquipmentModelVersion:DetectProtectiveEquipmentResponse' :: DetectProtectiveEquipmentResponse -> Maybe Text
protectiveEquipmentModelVersion} -> Maybe Text
protectiveEquipmentModelVersion) (\s :: DetectProtectiveEquipmentResponse
s@DetectProtectiveEquipmentResponse' {} Maybe Text
a -> DetectProtectiveEquipmentResponse
s {$sel:protectiveEquipmentModelVersion:DetectProtectiveEquipmentResponse' :: Maybe Text
protectiveEquipmentModelVersion = Maybe Text
a} :: DetectProtectiveEquipmentResponse)

-- | An array of persons detected in the image (including persons not wearing
-- PPE).
detectProtectiveEquipmentResponse_persons :: Lens.Lens' DetectProtectiveEquipmentResponse (Prelude.Maybe [ProtectiveEquipmentPerson])
detectProtectiveEquipmentResponse_persons :: (Maybe [ProtectiveEquipmentPerson]
 -> f (Maybe [ProtectiveEquipmentPerson]))
-> DetectProtectiveEquipmentResponse
-> f DetectProtectiveEquipmentResponse
detectProtectiveEquipmentResponse_persons = (DetectProtectiveEquipmentResponse
 -> Maybe [ProtectiveEquipmentPerson])
-> (DetectProtectiveEquipmentResponse
    -> Maybe [ProtectiveEquipmentPerson]
    -> DetectProtectiveEquipmentResponse)
-> Lens
     DetectProtectiveEquipmentResponse
     DetectProtectiveEquipmentResponse
     (Maybe [ProtectiveEquipmentPerson])
     (Maybe [ProtectiveEquipmentPerson])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectProtectiveEquipmentResponse' {Maybe [ProtectiveEquipmentPerson]
persons :: Maybe [ProtectiveEquipmentPerson]
$sel:persons:DetectProtectiveEquipmentResponse' :: DetectProtectiveEquipmentResponse
-> Maybe [ProtectiveEquipmentPerson]
persons} -> Maybe [ProtectiveEquipmentPerson]
persons) (\s :: DetectProtectiveEquipmentResponse
s@DetectProtectiveEquipmentResponse' {} Maybe [ProtectiveEquipmentPerson]
a -> DetectProtectiveEquipmentResponse
s {$sel:persons:DetectProtectiveEquipmentResponse' :: Maybe [ProtectiveEquipmentPerson]
persons = Maybe [ProtectiveEquipmentPerson]
a} :: DetectProtectiveEquipmentResponse) ((Maybe [ProtectiveEquipmentPerson]
  -> f (Maybe [ProtectiveEquipmentPerson]))
 -> DetectProtectiveEquipmentResponse
 -> f DetectProtectiveEquipmentResponse)
-> ((Maybe [ProtectiveEquipmentPerson]
     -> f (Maybe [ProtectiveEquipmentPerson]))
    -> Maybe [ProtectiveEquipmentPerson]
    -> f (Maybe [ProtectiveEquipmentPerson]))
-> (Maybe [ProtectiveEquipmentPerson]
    -> f (Maybe [ProtectiveEquipmentPerson]))
-> DetectProtectiveEquipmentResponse
-> f DetectProtectiveEquipmentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProtectiveEquipmentPerson]
  [ProtectiveEquipmentPerson]
  [ProtectiveEquipmentPerson]
  [ProtectiveEquipmentPerson]
-> Iso
     (Maybe [ProtectiveEquipmentPerson])
     (Maybe [ProtectiveEquipmentPerson])
     (Maybe [ProtectiveEquipmentPerson])
     (Maybe [ProtectiveEquipmentPerson])
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
  [ProtectiveEquipmentPerson]
  [ProtectiveEquipmentPerson]
  [ProtectiveEquipmentPerson]
  [ProtectiveEquipmentPerson]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DetectProtectiveEquipmentResponse