{-# 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.Rekognition.Types.ProtectiveEquipmentSummarizationAttributes
-- 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.Rekognition.Types.ProtectiveEquipmentSummarizationAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.ProtectiveEquipmentType

-- | Specifies summary attributes to return from a call to
-- DetectProtectiveEquipment. You can specify which types of PPE to
-- summarize. You can also specify a minimum confidence value for
-- detections. Summary information is returned in the @Summary@
-- (ProtectiveEquipmentSummary) field of the response from
-- @DetectProtectiveEquipment@. The summary includes which persons in an
-- image were detected wearing the requested types of person protective
-- equipment (PPE), which persons were detected as not wearing PPE, and the
-- persons in which a determination could not be made. For more
-- information, see ProtectiveEquipmentSummary.
--
-- /See:/ 'newProtectiveEquipmentSummarizationAttributes' smart constructor.
data ProtectiveEquipmentSummarizationAttributes = ProtectiveEquipmentSummarizationAttributes'
  { -- | The minimum confidence level for which you want summary information. The
    -- confidence level applies to person detection, body part detection,
    -- equipment detection, and body part coverage. Amazon Rekognition doesn\'t
    -- return summary information with a confidence than this specified value.
    -- There isn\'t a default value.
    --
    -- Specify a @MinConfidence@ value that is between 50-100% as
    -- @DetectProtectiveEquipment@ returns predictions only where the detection
    -- confidence is between 50% - 100%. If you specify a value that is less
    -- than 50%, the results are the same specifying a value of 50%.
    ProtectiveEquipmentSummarizationAttributes -> Double
minConfidence :: Prelude.Double,
    -- | An array of personal protective equipment types for which you want
    -- summary information. If a person is detected wearing a required
    -- requipment type, the person\'s ID is added to the
    -- @PersonsWithRequiredEquipment@ array field returned in
    -- ProtectiveEquipmentSummary by @DetectProtectiveEquipment@.
    ProtectiveEquipmentSummarizationAttributes
-> [ProtectiveEquipmentType]
requiredEquipmentTypes :: [ProtectiveEquipmentType]
  }
  deriving (ProtectiveEquipmentSummarizationAttributes
-> ProtectiveEquipmentSummarizationAttributes -> Bool
(ProtectiveEquipmentSummarizationAttributes
 -> ProtectiveEquipmentSummarizationAttributes -> Bool)
-> (ProtectiveEquipmentSummarizationAttributes
    -> ProtectiveEquipmentSummarizationAttributes -> Bool)
-> Eq ProtectiveEquipmentSummarizationAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProtectiveEquipmentSummarizationAttributes
-> ProtectiveEquipmentSummarizationAttributes -> Bool
$c/= :: ProtectiveEquipmentSummarizationAttributes
-> ProtectiveEquipmentSummarizationAttributes -> Bool
== :: ProtectiveEquipmentSummarizationAttributes
-> ProtectiveEquipmentSummarizationAttributes -> Bool
$c== :: ProtectiveEquipmentSummarizationAttributes
-> ProtectiveEquipmentSummarizationAttributes -> Bool
Prelude.Eq, ReadPrec [ProtectiveEquipmentSummarizationAttributes]
ReadPrec ProtectiveEquipmentSummarizationAttributes
Int -> ReadS ProtectiveEquipmentSummarizationAttributes
ReadS [ProtectiveEquipmentSummarizationAttributes]
(Int -> ReadS ProtectiveEquipmentSummarizationAttributes)
-> ReadS [ProtectiveEquipmentSummarizationAttributes]
-> ReadPrec ProtectiveEquipmentSummarizationAttributes
-> ReadPrec [ProtectiveEquipmentSummarizationAttributes]
-> Read ProtectiveEquipmentSummarizationAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProtectiveEquipmentSummarizationAttributes]
$creadListPrec :: ReadPrec [ProtectiveEquipmentSummarizationAttributes]
readPrec :: ReadPrec ProtectiveEquipmentSummarizationAttributes
$creadPrec :: ReadPrec ProtectiveEquipmentSummarizationAttributes
readList :: ReadS [ProtectiveEquipmentSummarizationAttributes]
$creadList :: ReadS [ProtectiveEquipmentSummarizationAttributes]
readsPrec :: Int -> ReadS ProtectiveEquipmentSummarizationAttributes
$creadsPrec :: Int -> ReadS ProtectiveEquipmentSummarizationAttributes
Prelude.Read, Int -> ProtectiveEquipmentSummarizationAttributes -> ShowS
[ProtectiveEquipmentSummarizationAttributes] -> ShowS
ProtectiveEquipmentSummarizationAttributes -> String
(Int -> ProtectiveEquipmentSummarizationAttributes -> ShowS)
-> (ProtectiveEquipmentSummarizationAttributes -> String)
-> ([ProtectiveEquipmentSummarizationAttributes] -> ShowS)
-> Show ProtectiveEquipmentSummarizationAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProtectiveEquipmentSummarizationAttributes] -> ShowS
$cshowList :: [ProtectiveEquipmentSummarizationAttributes] -> ShowS
show :: ProtectiveEquipmentSummarizationAttributes -> String
$cshow :: ProtectiveEquipmentSummarizationAttributes -> String
showsPrec :: Int -> ProtectiveEquipmentSummarizationAttributes -> ShowS
$cshowsPrec :: Int -> ProtectiveEquipmentSummarizationAttributes -> ShowS
Prelude.Show, (forall x.
 ProtectiveEquipmentSummarizationAttributes
 -> Rep ProtectiveEquipmentSummarizationAttributes x)
-> (forall x.
    Rep ProtectiveEquipmentSummarizationAttributes x
    -> ProtectiveEquipmentSummarizationAttributes)
-> Generic ProtectiveEquipmentSummarizationAttributes
forall x.
Rep ProtectiveEquipmentSummarizationAttributes x
-> ProtectiveEquipmentSummarizationAttributes
forall x.
ProtectiveEquipmentSummarizationAttributes
-> Rep ProtectiveEquipmentSummarizationAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProtectiveEquipmentSummarizationAttributes x
-> ProtectiveEquipmentSummarizationAttributes
$cfrom :: forall x.
ProtectiveEquipmentSummarizationAttributes
-> Rep ProtectiveEquipmentSummarizationAttributes x
Prelude.Generic)

-- |
-- Create a value of 'ProtectiveEquipmentSummarizationAttributes' 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:
--
-- 'minConfidence', 'protectiveEquipmentSummarizationAttributes_minConfidence' - The minimum confidence level for which you want summary information. The
-- confidence level applies to person detection, body part detection,
-- equipment detection, and body part coverage. Amazon Rekognition doesn\'t
-- return summary information with a confidence than this specified value.
-- There isn\'t a default value.
--
-- Specify a @MinConfidence@ value that is between 50-100% as
-- @DetectProtectiveEquipment@ returns predictions only where the detection
-- confidence is between 50% - 100%. If you specify a value that is less
-- than 50%, the results are the same specifying a value of 50%.
--
-- 'requiredEquipmentTypes', 'protectiveEquipmentSummarizationAttributes_requiredEquipmentTypes' - An array of personal protective equipment types for which you want
-- summary information. If a person is detected wearing a required
-- requipment type, the person\'s ID is added to the
-- @PersonsWithRequiredEquipment@ array field returned in
-- ProtectiveEquipmentSummary by @DetectProtectiveEquipment@.
newProtectiveEquipmentSummarizationAttributes ::
  -- | 'minConfidence'
  Prelude.Double ->
  ProtectiveEquipmentSummarizationAttributes
newProtectiveEquipmentSummarizationAttributes :: Double -> ProtectiveEquipmentSummarizationAttributes
newProtectiveEquipmentSummarizationAttributes
  Double
pMinConfidence_ =
    ProtectiveEquipmentSummarizationAttributes' :: Double
-> [ProtectiveEquipmentType]
-> ProtectiveEquipmentSummarizationAttributes
ProtectiveEquipmentSummarizationAttributes'
      { $sel:minConfidence:ProtectiveEquipmentSummarizationAttributes' :: Double
minConfidence =
          Double
pMinConfidence_,
        $sel:requiredEquipmentTypes:ProtectiveEquipmentSummarizationAttributes' :: [ProtectiveEquipmentType]
requiredEquipmentTypes =
          [ProtectiveEquipmentType]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The minimum confidence level for which you want summary information. The
-- confidence level applies to person detection, body part detection,
-- equipment detection, and body part coverage. Amazon Rekognition doesn\'t
-- return summary information with a confidence than this specified value.
-- There isn\'t a default value.
--
-- Specify a @MinConfidence@ value that is between 50-100% as
-- @DetectProtectiveEquipment@ returns predictions only where the detection
-- confidence is between 50% - 100%. If you specify a value that is less
-- than 50%, the results are the same specifying a value of 50%.
protectiveEquipmentSummarizationAttributes_minConfidence :: Lens.Lens' ProtectiveEquipmentSummarizationAttributes Prelude.Double
protectiveEquipmentSummarizationAttributes_minConfidence :: (Double -> f Double)
-> ProtectiveEquipmentSummarizationAttributes
-> f ProtectiveEquipmentSummarizationAttributes
protectiveEquipmentSummarizationAttributes_minConfidence = (ProtectiveEquipmentSummarizationAttributes -> Double)
-> (ProtectiveEquipmentSummarizationAttributes
    -> Double -> ProtectiveEquipmentSummarizationAttributes)
-> Lens
     ProtectiveEquipmentSummarizationAttributes
     ProtectiveEquipmentSummarizationAttributes
     Double
     Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtectiveEquipmentSummarizationAttributes' {Double
minConfidence :: Double
$sel:minConfidence:ProtectiveEquipmentSummarizationAttributes' :: ProtectiveEquipmentSummarizationAttributes -> Double
minConfidence} -> Double
minConfidence) (\s :: ProtectiveEquipmentSummarizationAttributes
s@ProtectiveEquipmentSummarizationAttributes' {} Double
a -> ProtectiveEquipmentSummarizationAttributes
s {$sel:minConfidence:ProtectiveEquipmentSummarizationAttributes' :: Double
minConfidence = Double
a} :: ProtectiveEquipmentSummarizationAttributes)

-- | An array of personal protective equipment types for which you want
-- summary information. If a person is detected wearing a required
-- requipment type, the person\'s ID is added to the
-- @PersonsWithRequiredEquipment@ array field returned in
-- ProtectiveEquipmentSummary by @DetectProtectiveEquipment@.
protectiveEquipmentSummarizationAttributes_requiredEquipmentTypes :: Lens.Lens' ProtectiveEquipmentSummarizationAttributes [ProtectiveEquipmentType]
protectiveEquipmentSummarizationAttributes_requiredEquipmentTypes :: ([ProtectiveEquipmentType] -> f [ProtectiveEquipmentType])
-> ProtectiveEquipmentSummarizationAttributes
-> f ProtectiveEquipmentSummarizationAttributes
protectiveEquipmentSummarizationAttributes_requiredEquipmentTypes = (ProtectiveEquipmentSummarizationAttributes
 -> [ProtectiveEquipmentType])
-> (ProtectiveEquipmentSummarizationAttributes
    -> [ProtectiveEquipmentType]
    -> ProtectiveEquipmentSummarizationAttributes)
-> Lens
     ProtectiveEquipmentSummarizationAttributes
     ProtectiveEquipmentSummarizationAttributes
     [ProtectiveEquipmentType]
     [ProtectiveEquipmentType]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtectiveEquipmentSummarizationAttributes' {[ProtectiveEquipmentType]
requiredEquipmentTypes :: [ProtectiveEquipmentType]
$sel:requiredEquipmentTypes:ProtectiveEquipmentSummarizationAttributes' :: ProtectiveEquipmentSummarizationAttributes
-> [ProtectiveEquipmentType]
requiredEquipmentTypes} -> [ProtectiveEquipmentType]
requiredEquipmentTypes) (\s :: ProtectiveEquipmentSummarizationAttributes
s@ProtectiveEquipmentSummarizationAttributes' {} [ProtectiveEquipmentType]
a -> ProtectiveEquipmentSummarizationAttributes
s {$sel:requiredEquipmentTypes:ProtectiveEquipmentSummarizationAttributes' :: [ProtectiveEquipmentType]
requiredEquipmentTypes = [ProtectiveEquipmentType]
a} :: ProtectiveEquipmentSummarizationAttributes) (([ProtectiveEquipmentType] -> f [ProtectiveEquipmentType])
 -> ProtectiveEquipmentSummarizationAttributes
 -> f ProtectiveEquipmentSummarizationAttributes)
-> (([ProtectiveEquipmentType] -> f [ProtectiveEquipmentType])
    -> [ProtectiveEquipmentType] -> f [ProtectiveEquipmentType])
-> ([ProtectiveEquipmentType] -> f [ProtectiveEquipmentType])
-> ProtectiveEquipmentSummarizationAttributes
-> f ProtectiveEquipmentSummarizationAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ProtectiveEquipmentType] -> f [ProtectiveEquipmentType])
-> [ProtectiveEquipmentType] -> f [ProtectiveEquipmentType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.Hashable
    ProtectiveEquipmentSummarizationAttributes

instance
  Prelude.NFData
    ProtectiveEquipmentSummarizationAttributes

instance
  Core.ToJSON
    ProtectiveEquipmentSummarizationAttributes
  where
  toJSON :: ProtectiveEquipmentSummarizationAttributes -> Value
toJSON
    ProtectiveEquipmentSummarizationAttributes' {Double
[ProtectiveEquipmentType]
requiredEquipmentTypes :: [ProtectiveEquipmentType]
minConfidence :: Double
$sel:requiredEquipmentTypes:ProtectiveEquipmentSummarizationAttributes' :: ProtectiveEquipmentSummarizationAttributes
-> [ProtectiveEquipmentType]
$sel:minConfidence:ProtectiveEquipmentSummarizationAttributes' :: ProtectiveEquipmentSummarizationAttributes -> Double
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                (Text
"MinConfidence" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Double
minConfidence),
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                ( Text
"RequiredEquipmentTypes"
                    Text -> [ProtectiveEquipmentType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [ProtectiveEquipmentType]
requiredEquipmentTypes
                )
            ]
        )